I recently installed an android app called Secret Space Encryptor and think I found a serious flaw in it.

Let me explain: This app provides a variety of different ciphers to use and I used Threefish 1024 to encrypt a test message with "Your Key" as the key.

I then saved the ciphertext to a text file using the export function in the app. Then I changed the text encryption program in the app to use Blowfish 448 and imported the TF-1024 encrypted message into the app once more.

I then entered the "Your Key" test key and to my total surprise the message successfully decrypted! I encrypted a message with one cipher and then decrypted that same message with a totally different cipher!

Now this should be totally impossible right? If so then is there a deadly flaw in this app?

  • 13
    $\begingroup$ maybe the encrypted data contains information about the cipher required to decrypt, so you cannot choose the wrong algorithm? $\endgroup$ – Richie Frame Sep 10 '15 at 20:14

I've checked out the source code (well, more or less, it's not that well designed, the main crypto class is 1600 lines) and as Richie guessed, the algorithm is stored together with the ciphertext.

Pretty gruesome stuff, but it does do EAX mode for text strings to my surprise. It probably only uses it for text strings originating from the password vault code though.

File encryption is performed in CBC mode. It does (ZIP) compress and stream files using CBC mode. It uses a static IV but this is offset by a random header that is included into the encryption.

This is a homegrown project with little documentation or comments in the code and a slightly erratic class design.

Thanks go out to Tron to supply us the link to the format defition on the Paranoiaworks website.

| improve this answer | |
  • $\begingroup$ Does storing the algorithm in the ciphertext compromise the security? $\endgroup$ – WAR10CK Sep 11 '15 at 0:25
  • 2
    $\begingroup$ @WAR10CK no it does not $\endgroup$ – Richie Frame Sep 11 '15 at 0:25
  • $\begingroup$ Storing the algorithm in the ciphertext does not compromise security provided that the algorithm identifier is treated as additional authenticated data when the message authentication code is calculated. $\endgroup$ – Henrick Hellström Sep 11 '15 at 7:59
  • $\begingroup$ @HenrickHellström Well, in practice it would be secure without storing it it in the authenticated data as well. It's good crypto practice to do so. In this case there is no authentication tag, just CBC mode of operation to store files locally and a CRC tag inside the .zip I presume. $\endgroup$ – Maarten Bodewes Sep 11 '15 at 10:00
  • $\begingroup$ Oh, yeah, in // Write Encrypted Header somewhere in the source code. Some kind of format description would be most welcome. $\endgroup$ – Maarten Bodewes Sep 11 '15 at 12:01

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.