[pycrypto] RSA exportKey question with bcrypt?

Manuel Pégourié-Gonnard mpg at elzevir.fr
Mon Jul 15 23:48:35 PDT 2013


Hi all,

On 15/07/2013 22:52, Legrandin wrote:
> I hope I understand correctly this time.
> The presence of a header like:
> 
> -----BEGIN RSA PRIVATE KEY-----
> Proc-Type: 4,ENCRYPTED
> DEK-Info: AES-256-CBC,16D792053CB9E5981B06E020900F86EA
> [...]
> 
> indicates that the PEM envelope is encrypted and that the inner PKCS#8
> structure is clear.
> 
I may be mistaken, but I think this header indicates that the key inside the PEM
envelope is in "naked" PKCS#1 format, not wrapped in PKCS#8.

My understanding is as follows:

-----BEGIN RSA RIVATE KEY----- 	PKCS#1 in a PEM envelope
-----BEGIN RIVATE KEY----- 	unencrypted PKCS#8 in a PEM envelope
-----BEGIN RSA RIVATE KEY----- 	encryptedd PKCS#8 in a PEM envelope

I agree with you that the PEM envelope may be encrypted only in the first case.

Manuel.


More information about the pycrypto mailing list