The answers to my previous question (How safe is XOR with multiple independent but non random keys?) revealed quite a few problems, to a degree that a new approach had to be developed.
I took the recommendations of @Daffy and put together a MessageSafe
product, which I need your comments about the degree of its security. Sorry, I understand this is more security than cryptography issue. Please, let me know if there is better place for the question.
Like before, I have a practical example with fake data. I have a highly valuable message, which is a private Bitcoin key written on paper.
MESSAGE = KwjwmREseNZmZ8yeNKrurN6qPuh9FhrLAefYa2nTLafLkGmWW9ta
So I go through the following security protocol:
- I take my kids' old iPod 4, and open the above HTML page in Safari browser.
- I disconnect Wi-Fi, Bluetooth, and put the iPod into Airplane Mode.
- I type the message and password into corresponding fields.
I press Encrypt and following happens:
- The password gets hashed by
bcrypt
- Password =
Horses will fly by 2050
- Salt (Hard-coded value) =
S\$2a\$12\$PVD.XSaA.GyzVZgknaw.jO
- KeyHash =
\$2a\$12\$PVD.XSaA.GyzVZgknaw.jOmMXANF67Cetb9jNkreUX54cdVwiMnp6
- Last 32 characters of KeyHash are the Key =
mMXANF67Cetb9jNkreUX54cdVwiMnp6
- The message is then encrypted by AES in CTR mode with the Key.
- The encrypted message is converted into
Base58
alphabet, spaced every 4 positions, and the secure code is below: - Code =
asKP-1JKq-2YbJ-qwT2-5h5d-fSSG-J5f4-rE6b-qDx5-jUx9-gXqg-zKWD-Q4Ga-ks73-XAnP-mxau-SzkN-b7UA-vN1x-zRbH-bdGo-w5t6-fzmb-PA1e-F
- The password gets hashed by
I magnify this code on the small iPod screen, so no other fields are visible, and make a picture of it with my phone.
I clear all the fields in the HTML form, and go the opposite direction, typing in the pictured code and the password and then press Decrypt.
If the message is successfully decrypted, the iPod has to be destroyed (preferably in fire)
The resulting secure code picture can be stored in mail, on drives, etc.
Suppose for now the authenticity of the program opened on iPod is not in question, there might be a special signature checking procedure to discuss later.
The question is: What am I missing? Is the security on par with the best practices? Can it or should it be improved?
I am interested in public review, because I will use the program myself and need to be sure.