我认为我的问题归结为事实是关键的问题,但我不能解密它,进一步调查,不parsing它。 但我不确定。
我正在尝试使用标准方法:
openssl rsa -in ./id_rsa -out ./id_rsa.decrypted
我想我知道密码,因为当我input错误的时候,我得到:
Enter pass phrase for ./id_rsa: unable to load Private Key 140256774473360:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:544: 140256774473360:error:0906A065:PEM routines:PEM_do_header:bad decrypt:pem_lib.c:483
“ 坏解密 ”很清楚。 现在,当我input我似乎很好的密码时,我回来了:
Enter pass phrase for ./id_rsa: unable to load Private Key 139662870623888:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:153: 139662870623888:error:0D068066:asn1 encoding routines:ASN1_CHECK_TLEN:bad object header:tasn_dec.c:1314: 139662870623888:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:381:Type=RSA 139662870623888:error:04093004:rsa routines:OLD_RSA_PRIV_DECODE:RSA lib:rsa_ameth.c:115: 139662870623888:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:153: 139662870623888:error:0D068066:asn1 encoding routines:ASN1_CHECK_TLEN:bad object header:tasn_dec.c:1314: 139662870623888:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:381:Type=PKCS8_PRIV_KEY_INFO 139662870623888:error:0907B00D:PEM routines:PEM_READ_BIO_PRIVATEKEY:ASN1 lib:pem_pkey.c:132:
它也没有加载密钥,但现在它失败了asn1parsing器,没有任何关于密码。
我可以以某种方式得到未encryption的密钥版本,并使用其他工具,看看有什么不对?
我已经看到一些post,改变了一些东西,看似好的密钥的可能原因不能parsing,但他们都工作在未encryption的版本。 但他们唯一的方法,我看到了真正的钥匙是以上的一个。
我相信你的私钥已被修改,因为我可以通过更改我刚刚创build的示例密码短语保护密钥中的单个字符来复制相同的错误消息。
你可以重现这个如下 –
[testuser @ whitehat .ssh] $ openssl rsa -in id_rsa -out id_rsa.decrypted inputid_rsa的密码短语: 写RSA密钥 [testuser @ whitehat .ssh] $ ls -al id_rsa * -rw -------。 1 testuser testuser 951 Mar 24 15:01 id_rsa -rw-RW-R--。 1 testuser testuser 887 3月24日15:02 id_rsa.decrypted -rw-R - R--。 1 testuser testuser 236 Mar 24 14:52 id_rsa.pub [testuser @ whitehat .ssh] $ vim id_rsa [testuser @ whitehat .ssh] $ openssl rsa -in id_rsa -out id_rsa.decrypted inputid_rsa的密码短语: 无法加载私钥 139900595279688:错误:0D07207B:asn1编码例程:ASN1_get_object:头太长:asn1_lib.c:150: 139900595279688:错误:0D068066:asn1编码例程:ASN1_CHECK_TLEN:错误的对象头文件:tasn_dec.c:1306: 139900595279688:错误:0D07803A:asn1编码例程:ASN1_ITEM_EX_D2I:嵌套asn1错误:tasn_dec.c:381:Type = RSA 139900595279688:错误:04093004:rsa例程:OLD_RSA_PRIV_DECODE:RSA lib:rsa_ameth.c:115: 139900595279688:错误:0D07207B:asn1编码例程:ASN1_get_object:头太长:asn1_lib.c:150: 139900595279688:错误:0D068066:asn1编码例程:ASN1_CHECK_TLEN:错误的对象头文件:tasn_dec.c:1306: 139900595279688:错误:0D07803A:asn1编码例程:ASN1_ITEM_EX_D2I:嵌套asn1错误:tasn_dec.c:381:Type = PKCS8_PRIV_KEY_INFO 139900595279688:错误:0907B00D:PEM例程:PEM_READ_BIO_PRIVATEKEY:ASN1 lib:pem_pkey.c:132: [testuser @ whitehat .ssh] $
操作系统和openssl版本信息
[testuser @ whitehat /] $ lsb_release -a LSB版本:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch 经销商编号:Scientific 说明:科学Linux版本6.2(碳) 版本:6.2 代号:碳 [testuser @ whitehat /] $ rpm -q openssl 的OpenSSL 1.0.1e-30.el6_6.5.x86_64