Page 1 of 1

Decrypt in memory?

Posted: Sat Sep 23, 2017 6:29 pm
by JaPol
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

Re: Decrypt in memory?

Posted: Sun Sep 24, 2017 2:46 am
by paulej
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.

Re: Decrypt in memory?

Posted: Sun Sep 24, 2017 11:43 am
by JaPol
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

Re: Decrypt in memory?

Posted: Sun Sep 24, 2017 1:10 pm
by paulej
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.

Re: Decrypt in memory?

Posted: Mon Sep 25, 2017 7:46 am
by JaPol
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

Re: Decrypt in memory?

Posted: Tue Sep 26, 2017 12:24 am
by paulej
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.

Re: Decrypt in memory?

Posted: Tue Sep 26, 2017 5:11 am
by JaPol
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.

Re: Decrypt in memory?

Posted: Tue Sep 26, 2017 1:51 pm
by paulej
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.