Page 1 of 2

Reading the key file on Windows

Posted: Wed Apr 02, 2014 3:31 pm
by gvg1
Hi,
We are trying to decrypt the file on windows using Shared key.I saw in one of your posts that windows doesnt support "-k" option.Is there any way that we can read the contents of key file on the windows command line using -p.Is so can you please provide the syntax??

Re: Reading the key file on Windows

Posted: Wed Apr 02, 2014 8:40 pm
by paulej
If the key file is generated on Linux using aescrypt_keygen, sure. Just open the key file using notepad and copy the contents. The keys generated with that tool are nothing more than random characters that are the password. There is no separate logic for keys, per se. So, you just take the contents of the file and use with -p.

Re: Reading the key file on Windows

Posted: Fri May 09, 2014 1:35 am
by nabila12
hi mr paul,

may i know how to use sha256.c in aescrypt? what is actually the function of it in aescrypt?
thanks

Re: Reading the key file on Windows

Posted: Fri May 09, 2014 12:57 pm
by paulej
nabila12 wrote:may i know how to use sha256.c in aescrypt? what is actually the function of it in aescrypt?
thanks
SHA-256 is used for two things. One is to try to create a "more random" password. The user's password is hashed using SHA-256 about 8192 times. This might not be terribly effective, but some passwords people use are very weak.

The other use is post of the HMAC computation that ensures message integrity.

Re: Reading the key file on Windows

Posted: Tue May 13, 2014 8:28 am
by nabila12
Sir, thank you for the explanation. But may i know the command to implement it in aescrypt? thanks again

Re: Reading the key file on Windows

Posted: Tue May 13, 2014 6:30 pm
by paulej
nabila12 wrote:Sir, thank you for the explanation. But may i know the command to implement it in aescrypt? thanks again
On Linux, the command-line looks like this:

Code: Select all

$ aescrypt -d -k keyfile.txt encrypted_file.txt
Paul

Re: Reading the key file on Windows

Posted: Wed May 14, 2014 2:41 am
by nabila12
sir,

does it mean that the .key file contains 32 bytes output after hashing using sha256?the function of the .key file is just the same with password, am i right? but why i cant open the .key file?

Re: Reading the key file on Windows

Posted: Wed May 14, 2014 6:12 am
by paulej
nabila12 wrote:sir,

does it mean that the .key file contains 32 bytes output after hashing using sha256?the function of the .key file is just the same with password, am i right? but why i cant open the .key file?
The key file is actually just a UTF-16 encoded password file. This could be created with notepad on windows, for example. The key file concept was introduced just to help with automated backups where very long passwords are used. Any kind of automated process could use key files, of course.

Re: Reading the key file on Windows

Posted: Thu May 15, 2014 2:32 am
by nabila12
Sir,

Many thanks for your reply..the key file stored the random password generated by sha256, right? but that key file is also sent to the receiver along with encrypted file,which is dangerous if other users get that keyfile?

Re: Reading the key file on Windows

Posted: Thu May 15, 2014 3:35 am
by paulej
nabila12 wrote:Sir,

Many thanks for your reply..the key file stored the random password generated by sha256, right? but that key file is also sent to the receiver along with encrypted file,which is dangerous if other users get that keyfile?
The key file is either just a password in a file or its random data. AES Crypt on Linux will create a key file with random data of whatever length requested. SHA256 doesn't come into play.

You're right that you don't want to send the encrypted file and key together. That would allow anyone to read the file.