Decrypt in memory?

Discussion related to AES Crypt, the file encryption software for Windows, Linux, Mac, and Java.
Post Reply
JaPol
Posts: 4
Joined: Sat Sep 23, 2017 6:21 pm

Decrypt in memory?

Post by JaPol » Sat Sep 23, 2017 6:29 pm

Hello,
First thanks for the software, I'm using the windows command line, is very useful. I'd like to know if is possible to decrypt the file in "memory" without save it like a real file and pass it to the default software for open it. Example I have hello.jpg.aes, when I'm decrypt it I don't want to have the hello.jpg but directly open the jpg without save it to the disk like file but from RAM. Is possible? If not, I'll ask this question like a feature request
Thanks

User avatar
paulej
Posts: 525
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: Decrypt in memory?

Post by paulej » Sun Sep 24, 2017 2:46 am

That's only useful for programmers. If one decrypts to RAM, it's useless without something acting on that RAM.

The simplest thing would be to take the current code and modify it to do what you want.

If you want a set of functions to encrypt and decrypt in RAM, you could use the AES String Crypt library. It produces a version 0 file format and only consumes a version 0 format. Version 0 is most optimal for smaller sizes, while the newer formats are flexible enough to stream and encrypt/decrypt data far larger than can be stored in RAM.

JaPol
Posts: 4
Joined: Sat Sep 23, 2017 6:21 pm

Re: Decrypt in memory?

Post by JaPol » Sun Sep 24, 2017 11:43 am

I'm not agree. I'm not a programmer but this function can be really useful. Decrypt a file without create a "real file" remove the problem of delete the output file, with safe delete or not and on SSD safe delete is not really safe.

Example:
https://www.codeproject.com/Articles/79 ... Decrypting
https://social.msdn.microsoft.com/Forum ... disk?forum

Thanks

User avatar
paulej
Posts: 525
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: Decrypt in memory?

Post by paulej » Sun Sep 24, 2017 1:10 pm

Let's say it decrypts a file to memory. How do you plan to access it? And once the program exits, you won't have access to the memory, either.

This is really only useful to people integrating the code into other programs. It's not something useful otherwise.

JaPol
Posts: 4
Joined: Sat Sep 23, 2017 6:21 pm

Re: Decrypt in memory?

Post by JaPol » Mon Sep 25, 2017 7:46 am

From the guide:
What if you want to decrypt a file, but just want to have it displayed on the screen and not stored in a plaintext file? That's possible. To do that, just use this syntax:
aescrypt -d -o -passwords.txt.aes

If i'll try to the the same with a another type of file, like a little jpeg, the is an infinite wall of text. I think is a bug, not the data of the decrypted file inside the CMD since that's normal, but that never stop to decrypt...
Image

I don't think this is a normal behavior

User avatar
paulej
Posts: 525
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: Decrypt in memory?

Post by paulej » Tue Sep 26, 2017 12:24 am

After the -o you need hyphen. Looks like you need a space before passwords.txt.aes. That means to send it to "standard out", which is your screen at the command line.

However, if the file is binary, it would look like that.

JaPol
Posts: 4
Joined: Sat Sep 23, 2017 6:21 pm

Re: Decrypt in memory?

Post by JaPol » Tue Sep 26, 2017 5:11 am

Yes a binary file look like that but it NEVER stop. If I'll set an output, in 1 second aescrypt will decrypt it. If I'll set the standard output of CMD, the same file, after 10 minute is still there. Try out and you'll see, there is something wrong. I'll repeat, with a .txt work fine, with another type of file ( mine was a .jpeg ) not.

User avatar
paulej
Posts: 525
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: Decrypt in memory?

Post by paulej » Tue Sep 26, 2017 1:51 pm

I created a test file on my desktop with a bunch of lines of text in it. I called it "passwords.txt". I then encrypted it. I then went to the command prompt and typed the following command and received the corresponding output:

Code: Select all


C:\Program Files\AESCrypt>aescrypt.exe -d -p abc123 -o - c:\users\paulej\Desktop\passwords.txt.aes
test file
test
this is a test
line here
another line
another line
another line
another line
another line
another line
another line
another line
another line
another line
another line
another line
another line
another line
another line
another line
another line
another line
another line
another line
another line
another line
another line
another line
another line
another line
another line
and last line
Seems to work just fine. I don't know why the binary file is presenting issues, but it might either just be that the command window cannot properly deal with the binary or the file is really large and it's very slow to output. I'm pretty sure it's not a bug in aescrypt.exe, though.

Post Reply

Return to “AES Crypt”