Reading the key file on Windows

Discussion related to AES Crypt, the file encryption software for Windows, Linux, Mac, and Java.
gvg1
Posts: 1
Joined: Wed Apr 02, 2014 3:27 pm

Reading the key file on Windows

Post 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??
User avatar
paulej
Posts: 595
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: Reading the key file on Windows

Post 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.
nabila12
Posts: 11
Joined: Wed May 15, 2013 10:00 am

Re: Reading the key file on Windows

Post 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
User avatar
paulej
Posts: 595
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: Reading the key file on Windows

Post 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.
nabila12
Posts: 11
Joined: Wed May 15, 2013 10:00 am

Re: Reading the key file on Windows

Post by nabila12 »

Sir, thank you for the explanation. But may i know the command to implement it in aescrypt? thanks again
User avatar
paulej
Posts: 595
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: Reading the key file on Windows

Post 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
nabila12
Posts: 11
Joined: Wed May 15, 2013 10:00 am

Re: Reading the key file on Windows

Post 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?
User avatar
paulej
Posts: 595
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: Reading the key file on Windows

Post 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.
nabila12
Posts: 11
Joined: Wed May 15, 2013 10:00 am

Re: Reading the key file on Windows

Post 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?
User avatar
paulej
Posts: 595
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: Reading the key file on Windows

Post 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.
Post Reply