sphinx-kotlin icon indicating copy to clipboard operation
sphinx-kotlin copied to clipboard

Export Key Custom Password Functionality

Open 05nelsonm opened this issue 4 years ago • 0 comments

Currently Exporting of Keys (as well as other necessary data) to setup Sphinx on a different device encrypts the output string with the User's PIN.

6 character length of character pool of 10x chars using 10_000 hash iterations of PBKDF2WithHmacSHA1 is very vulnerable if the string value (which is sent to the clipboard, a known threat vector) lands in the wrong hands.

Analyzing chain of custody of the exported string value shows that it touches many different interfaces while the User migrates it over to their other device; interfaces that other applications have access to.

2nd order impacts of this string value being decrypted are loss of funds, exposing private chat messages, etc. etc.

Ideally, if still utilizing the user's PIN to encrypt/decrypt, hash Iterations would be best bumped up to something extremely high (250k - 500k) which would offset the low combination.

Alternatively, pre-generating a strong password via SecureRandom, Base32 encoding, and adding tacs (-) every 5 characters would allow for a lower hash iteration count, make the exported string value far less vulnerable to maliciousness, and promote best practices.

05nelsonm avatar Mar 01 '21 21:03 05nelsonm