Password protected RSA keys and PKI package



Hi everyone,
I'm trying to use RSA public keys protected by a password, seems the latest PKI package allows to do this, but I'm encountering strange issues.
Simple unencrypted RSA keys work ok:

% package require pki
0.3
% set key [ ::pki::pkcs::parse_key [ ::fileutil::cat normal.key ] ]
l 1024 d 896...<skipped>...217 e 65537 type rsa n 140...<skipped>...431

normal.key is just a simple base64-encoded public key:
-----BEGIN RSA PRIVATE KEY-----
MII...<skipped>...Ioc=
-----END RSA PRIVATE KEY-----

Now I try to protect it with a password:
% openssl rsa -in normal.key -out encrypted.key -des3
writing RSA key
Enter PEM pass phrase: password
Verifying - Enter PEM pass phrase: password

This is how the encrypted key looks like:
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,553FB844B17CCBBC

p3e...<skipped>...w==
-----END RSA PRIVATE KEY-----

And when I try to parse it I get the following:
% set key [ ::pki::pkcs::parse_key [ ::fileutil::cat encrypted.key ] ] password
can't read "parsed_key(data)": no such element in array

Am I missing something?

--
Best regards, Eugene.
.



Relevant Pages

  • Key combinations in RSA Encryption Scheme
    ... I have recently developed one excel program which generates n numbers ... Many private keys & many corresponding public keys. ... Then How RSA can be cracked once we find the factor of Modulus? ...
    (sci.crypt)
  • Re: RSA imperfection
    ... lakis wrote: ... > Suppose that users Alice,Bob,Carol have the following public keys ... > using RSA, the same message M to the above three users. ... Is that homework? ...
    (sci.crypt)
  • Re: openssh publickey auth not working any more
    ... Excuse me, so you did -- I didn't read your transcript carefully enough ... it should be rsa). ... One problem is that you have not restarted sshd since installing 3.1 -- ... ~/.ssh/authorized_keys2 for public keys, ...
    (comp.security.ssh)
  • how to use Public-key in F-Secure SSH for windows?
    ... few public keys are generated thru the following path: ... key type: RSA ... I am expecting to see the content of the authorized_keys file something ...
    (SSH)
  • RSA imperfection
    ... Suppose that users Alice,Bob,Carol have the following public keys ... using RSA, the same message M to the above three users. ... M. Suggest a simple montification that prevents the decipherment. ...
    (sci.crypt)