If I was given an encrypted .key file (no further information about the key), called "abcd.key.enc," how would I start characterizing and identifying information about the key, its encryption/ cipher used, etc...?

My ultimate goal is to decrypt the key, but I can't find any trivial ways to determine anything about the key itself, especially since I can't read the cipher text. The best I can think of is to run linux "strings" against the key file which gives me the output

3Nj3 !/'i9

thanks for any help!


In general, if the file has been encrypted using a secure modern cipher and contains no metadata to indicate the encryption method used, you cannot determine the method just by examining the file. See e.g this answer by Thomas Pornin for more information.

At best, the size of the file may put some constraints on both the length of the encrypted key and on the encryption method used (since different encryption methods have different amounts of overhead), but such constraints are necessarily rather broad. If you know that the file is very old (say, from the 1980s or earlier), that may also narrow down the possible options.

Probably your best bet, however, in the absence of actual documentation about the encryption used, is to try to reverse engineer the software (or hardware!) that knows how to encrypt and/or decrypt the key file. After all, something must know how to decrypt the file, for it to be of any use to anybody at all.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.