Decrypt DES-CBC RSA private key
#1
Hi everybody

I'm trying to figure out how to decrypt RSA private key with hashcat.

I've generated a private key with openssl like this
Code:
openssl genrsa -des -passout pass:1234 1536

So encryption is DES-CBC, the passpharse is fairly simple - 1234 (it's just for test reasons).

Example of resulting key is
Code:
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-CBC,E828531F782F4302

U6p58zsHpF/jXjhfmmzBJRu75QqmA/oLVZtgYwh5RbROZx/GUIyDZlXxZnes7EW4
ZaepH6/kgCc8AslKU602uvl6HL0Iikbp/UXXNrhNiMSuglIh9c3TPbwN33RkFKS7
sI7Niz8JWP9kzqekT6RlVX454vHXM3yrSoCV5PS6wPGSQltqCJt62uHmFzpGoONT
9j4F1wGzhVevbrCLadAl/NOs6NSxJQ3wUZz2DWS4u362MSLXcoA19JyKeJtZbch6
Py0Zm87dhuvFsotmJ1tLKLCRedjiQ+syQMr4fOF9PyYRWAgnMOrliSDVQyNqsWo1
YSUsyVWxxLdFxQF789AZzHLyTvJOLkfIhXHO/euasyHTZdXV5wAHCyWXwq722rLE
m9lVHtQwpbmStrh2pU5Z/E2sRENu13rCJmXBYdE5AFmdqP6/ss5Gb+CUTUnm/Bnc
RNCkGaaLEeu8zPoprgebj9xIIPAmSLkg8towBqj4Q+VFciScIeNa5DqKFMBwuF3j
SmjkLxb7jL5//M7Hmhm5Ki/hpr02bbr7GZD5P98VteZwUO+H/hk82Jsaq6v6Q5Eg
loVarhfz4eKV89UZQKaogaOyNKG+EZhDingzx81bZFU5TEyuHG+xTJIEbKhCfYW/
s+sGknE3gkXWrgMAxwcyhlLbeWTsxEYbs+KdcrAn5Y86Ud0JZPT1DUC74qkHul/d
XjhWXj44dMMeuShG0M2URQQ6QKjgATRhQviAzuyKzzoySRJucMGg4btousnSgFsK
Pt+8DArkHIejSoBa3wI33l7NizLrPbEbBXMGHXz/j8hDd5tfGosOGu2JKBbb9mqF
D6FkPPOCrS31vG2jmViSG/CgUjA7YEcVKZBZKGVqiYtbX9lO2FHwRuX4ZN5GJOcL
KNoiCHyOmnVt7Vl6k4wtpDnlLk458URp+xYN+CmBlCkxILRi7Xiuq3PX50n6iPqF
AuhWUD+GooPIZP742qKzQ1vZPhWWA93P0wBEzBipC3lfQMnWaL5JNv0meR71Kves
77tGqo17Q1rjGXJZZr2FSt+u0p/HKpQEEfsP6+RgE9gNTRahfd0UwAGOvTWqic7b
QuNkFyvOvUKsE/OxN1S9YJIdEHafqwJAPWJYsyEAJrbDfZ4vn7hXIcbVoB05YlvN
oF0TKJRa0sXUtVCPwkOmEOL66LaD3m5b1a161GA3VgoTNVujsQwNIw==
-----END RSA PRIVATE KEY-----

Now I'm trying to feed whole key to hashcat
Code:
hashcat64.exe -a 3 -w 3 -m 1500 private.key

Got this error
Code:
Hashfile 'private.key' on line 1 (-----BEGIN RSA PRIVATE KEY-----): Token length exception
Hashfile 'private.key' on line 2 (Proc-Type: 4,ENCRYPTED): Token length exception
Hashfile 'private.key' on line 3 (DEK-Info: DES-CBC,59A46C68A8D8EA3D): Token length exception
Hashfile 'private.key' on line 5 (ESBmXm...epPx92kMu8zaKFPErsKsGftS7SJ1/tMp): Token length exception
Hashfile 'private.key' on line 6 (qUtpJf...wRWDhpaBkM65pSgGgJzTVmNj9Fu2GLbX): Token length exception
Hashfile 'private.key' on line 7 (pKQ9XB...QOt2IhwKvfqO2Mf0kYkM4V6DDUlVD642): Token length exception
Hashfile 'private.key' on line 8 (hnOg9X...btNkz/I1yS47JgHERGTp+n2fpAqT+lBf): Token length exception
Hashfile 'private.key' on line 9 (tA8QmC...3UN8J2xEKXConT2rKi+sSwydg2wr/gpe): Token length exception
Hashfile 'private.key' on line 10 (HQL+C6...WRq2LB5kmGUL9AB6YKawXGQ997eg5QqV): Token length exception
Hashfile 'private.key' on line 11 (Y9062m...eTI/MRATLa487YOoN7+0O/D31BlU40Ek): Token length exception
Hashfile 'private.key' on line 12 (kO0AiJ...QNAFJDxJLEC7DXN15pzxiF26GPUAe748): Token length exception
Hashfile 'private.key' on line 13 (pgsFBI...HgIGrigi8PLlNAZEmcB3KO4Jn9fbBU5Z): Token length exception
Hashfile 'private.key' on line 14 (NcN84g...DsOMQi0P3kWHYrwZpr/4KSQV+AVv6Oa9): Token length exception
Hashfile 'private.key' on line 15 (/7U40t...vaJflb51s2RVc04hO149Juq7NTqxfQAL): Token length exception
Hashfile 'private.key' on line 16 (XExfwC...1HoOV+m5u8rGyw4yjIu4SaOyklDyyW1t): Token length exception
Hashfile 'private.key' on line 17 (9XgoG1...ju4XWHgaWPNFa+CzdgNNWqYs7n4xNjmT): Token length exception
Hashfile 'private.key' on line 18 (9dQ4wa...KT/H+u32rmKW7HXzgekHekhxjzt9F5Qc): Token length exception
Hashfile 'private.key' on line 19 (Jx/Mav...K2b3oGi+aaRNuDVVY58CsDm8JnAGAhpL): Token length exception
Hashfile 'private.key' on line 20 (W3bUjP...oduA6At/qhJ1l3Yy7rkzUYdkaIcuPR1Y): Token length exception
Hashfile 'private.key' on line 21 (hKaXAw...FBvPHfCYaU+FL3DqzBOoSTwGM63lE979): Token length exception
Hashfile 'private.key' on line 22 (T6Ewy4...9qHd8IjSv2QPzV9gEIUP9xZrUfgYbjzP): Token length exception
Hashfile 'private.key' on line 23 (qwqSo1...7eMqJgcGaQ/BMqUBfZBaB0zYVUeAhA==): Token length exception
Hashfile 'private.key' on line 24 (-----END RSA PRIVATE KEY-----): Token length exception
No hashes loaded.

Same issue in case using only key body
Code:
U6p58zsHpF/jXjhfmmzBJRu75QqmA/oLVZtgYwh5RbROZx/GUIyDZlXxZnes7EW4
ZaepH6/kgCc8AslKU602uvl6HL0Iikbp/UXXNrhNiMSuglIh9c3TPbwN33RkFKS7
sI7Niz8JWP9kzqekT6RlVX454vHXM3yrSoCV5PS6wPGSQltqCJt62uHmFzpGoONT
9j4F1wGzhVevbrCLadAl/NOs6NSxJQ3wUZz2DWS4u362MSLXcoA19JyKeJtZbch6
Py0Zm87dhuvFsotmJ1tLKLCRedjiQ+syQMr4fOF9PyYRWAgnMOrliSDVQyNqsWo1
YSUsyVWxxLdFxQF789AZzHLyTvJOLkfIhXHO/euasyHTZdXV5wAHCyWXwq722rLE
m9lVHtQwpbmStrh2pU5Z/E2sRENu13rCJmXBYdE5AFmdqP6/ss5Gb+CUTUnm/Bnc
RNCkGaaLEeu8zPoprgebj9xIIPAmSLkg8towBqj4Q+VFciScIeNa5DqKFMBwuF3j
SmjkLxb7jL5//M7Hmhm5Ki/hpr02bbr7GZD5P98VteZwUO+H/hk82Jsaq6v6Q5Eg
loVarhfz4eKV89UZQKaogaOyNKG+EZhDingzx81bZFU5TEyuHG+xTJIEbKhCfYW/
s+sGknE3gkXWrgMAxwcyhlLbeWTsxEYbs+KdcrAn5Y86Ud0JZPT1DUC74qkHul/d
XjhWXj44dMMeuShG0M2URQQ6QKjgATRhQviAzuyKzzoySRJucMGg4btousnSgFsK
Pt+8DArkHIejSoBa3wI33l7NizLrPbEbBXMGHXz/j8hDd5tfGosOGu2JKBbb9mqF
D6FkPPOCrS31vG2jmViSG/CgUjA7YEcVKZBZKGVqiYtbX9lO2FHwRuX4ZN5GJOcL
KNoiCHyOmnVt7Vl6k4wtpDnlLk458URp+xYN+CmBlCkxILRi7Xiuq3PX50n6iPqF
AuhWUD+GooPIZP742qKzQ1vZPhWWA93P0wBEzBipC3lfQMnWaL5JNv0meR71Kves
77tGqo17Q1rjGXJZZr2FSt+u0p/HKpQEEfsP6+RgE9gNTRahfd0UwAGOvTWqic7b
QuNkFyvOvUKsE/OxN1S9YJIdEHafqwJAPWJYsyEAJrbDfZ4vn7hXIcbVoB05YlvN
oF0TKJRa0sXUtVCPwkOmEOL66LaD3m5b1a161GA3VgoTNVujsQwNIw==

Result
Code:
Hashfile 'key_body.txt' on line 1 (U6p58z...VZtgYwh5RbROZx/GUIyDZlXxZnes7EW4): Token length exception
Hashfile 'key_body.txt' on line 2 (ZaepH6.../UXXNrhNiMSuglIh9c3TPbwN33RkFKS7): Token length exception
Hashfile 'key_body.txt' on line 3 (sI7Niz...SoCV5PS6wPGSQltqCJt62uHmFzpGoONT): Token length exception
Hashfile 'key_body.txt' on line 4 (9j4F1w...UZz2DWS4u362MSLXcoA19JyKeJtZbch6): Token length exception
Hashfile 'key_body.txt' on line 5 (Py0Zm8...QMr4fOF9PyYRWAgnMOrliSDVQyNqsWo1): Token length exception
Hashfile 'key_body.txt' on line 6 (YSUsyV...hXHO/euasyHTZdXV5wAHCyWXwq722rLE): Token length exception
Hashfile 'key_body.txt' on line 7 (m9lVHt...JmXBYdE5AFmdqP6/ss5Gb+CUTUnm/Bnc): Token length exception
Hashfile 'key_body.txt' on line 8 (RNCkGa...8towBqj4Q+VFciScIeNa5DqKFMBwuF3j): Token length exception
Hashfile 'key_body.txt' on line 9 (SmjkLx...GZD5P98VteZwUO+H/hk82Jsaq6v6Q5Eg): Token length exception
Hashfile 'key_body.txt' on line 10 (loVarh...ingzx81bZFU5TEyuHG+xTJIEbKhCfYW/): Token length exception
Hashfile 'key_body.txt' on line 11 (s+sGkn...s+KdcrAn5Y86Ud0JZPT1DUC74qkHul/d): Token length exception
Hashfile 'key_body.txt' on line 12 (XjhWXj...QviAzuyKzzoySRJucMGg4btousnSgFsK): Token length exception
Hashfile 'key_body.txt' on line 13 (Pt+8DA...BXMGHXz/j8hDd5tfGosOGu2JKBbb9mqF): Token length exception
Hashfile 'key_body.txt' on line 14 (D6FkPP...KZBZKGVqiYtbX9lO2FHwRuX4ZN5GJOcL): Token length exception
Hashfile 'key_body.txt' on line 15 (KNoiCH...+xYN+CmBlCkxILRi7Xiuq3PX50n6iPqF): Token length exception
Hashfile 'key_body.txt' on line 16 (AuhWUD...0wBEzBipC3lfQMnWaL5JNv0meR71Kves): Token length exception
Hashfile 'key_body.txt' on line 17 (77tGqo...EfsP6+RgE9gNTRahfd0UwAGOvTWqic7b): Token length exception
Hashfile 'key_body.txt' on line 18 (QuNkFy...PWJYsyEAJrbDfZ4vn7hXIcbVoB05YlvN): Token length exception
Hashfile 'key_body.txt' on line 19 (oF0TKJ...6LaD3m5b1a161GA3VgoTNVujsQwNIw==): Token length exception
No hashes loaded.

Any help appreciated
Reply
#2
RSA is not supported.

-m 1500 = descrypt is something completely diffrerent.

we actually have a feature request for RSA here: https://github.com/hashcat/hashcat/issues/108 , but it doesn't seem that many hashcat users are very interested in the addition of this algo.

I think jtr supports it, but I'm not sure.
Reply
#3
The goal is not to crack RSA, but get private key text contents encrypted with DES algorithm. It's not possible with hashcat?
Reply
#4
no
Reply
#5
Ok, thx
Reply