Closed umitseyhan75 closed 2 years ago
Thank you for the video!
It seems you encrypted the file with a password but tried to decrypt with your encryption private key. The password for the encrypted file was not the same as the password protecting your private key, leading to an error.
What you did at the end was the right approach. Encrypted files don't reveal which method (password, keyfile, password + keyfile, or encryption private key) was used for encryption. Therefore, you have to specify what you did like so:
// Default encryption private key (stored in %USERPROFILE%/.kryptor)
$ kryptor -d file.txt
// Non-default encryption private key (not in %USERPROFILE%/.kryptor)
$ kryptor -d -x:"encryption.private" file.txt
// Password
$ kryptor -d -p file.txt
or
$ kryptor -d -p:"password" file.txt
Those earlier attempts said 'Decrypting private key...' instead of 'Deriving encryption key from password...'. That was a more recent change to try to make things clearer. However, 'Enter your password' is the same for password and private key decryption, which is understandably confusing, just convenient code wise. I can look into improving that.
I hope that helps. Let me know if you have any questions.
kryptor -d -p [File Name]
worked. kryptor -d -p:"passphrase" [File Name]
probably would work either.
But yes, I see a confusing approach here. Kryptor assumes I encrypted the file with private key when decrypting without letting me know.
kryptor -d [File Name]
should've worked.
kryptor -d [File Name] should've worked.
The problem is there's no way for anybody but you to know what you did to encrypt the file. That's by design to reveal minimal information. In other words, it's not possible for that to work in all cases. It either has to default to password-based encryption or private key based encryption.
Description
Interactively created passphrase does not work. Neither when it is pasted nor typed by hand.
Steps to reproduce
kryptor -e -p -n [File Name]
to encrypt.Enter
to create auto passphrase.kryptor -d [File Name]
command to decrypt.Expected behaviour
Successfully decrypt the file.
Screenshot
https://user-images.githubusercontent.com/43583375/173881961-90746dd8-988a-481f-8825-1ffb5d6ac898.mp4
Platform info