samuel-lucas6 / Kryptor

A simple, modern, and secure encryption and signing tool that aims to be a better version of age and Minisign.
https://www.kryptor.co.uk
GNU General Public License v3.0
414 stars 33 forks source link

❓ Question: Is it possible to enter the password before ? #17

Closed ghost closed 3 years ago

samuel-lucas6 commented 3 years ago

Hi , I'am new in use of crypto and I would like to know if it's possible to enter the password when I do " Kryptor -y 'public key' -e file to encrypt "( before the terminal ask me ) . Am I obligated ton modify PassowrdPrompt ?

When specifying a public key, Kryptor will use your private key for encryption rather than asking for a password. As for your other question, it's not possible to specify a password as part of the command because passwords shouldn't really be stored as strings. Strings are immutable in .NET and cannot be zeroed out, so I decided to store the password in a char array instead.

However, you could modify the -p|--password option to have CommandOptionType.SingleValue in the Program class. Then you'd need to make a few changes to the CommandLine class to use the string password instead of calling PasswordPrompt.

I hope that's helpful :)