spieglt / Cloaker

Simple, drag-and-drop, password-based file encryption
GNU General Public License v3.0
405 stars 38 forks source link

File encrypted with Cloaker GUI can't be decrypted by Cloaker CLI (Linux) #3

Closed logix2 closed 5 years ago

logix2 commented 5 years ago

A file I encrypted using Cloaker GUI (version 2.0 - I used the precompiled binary) can't be decrypted using Cloaker CLI (version 2.0 - I compiled the binary myself since the precompiled binary doesn't seem to include the CLI).

I'm using Ubuntu 19.04.

spieglt commented 5 years ago

Hmm, sorry to hear that. I just encrypted a file with the GUI on Ubuntu 19 and then decrypted with the CLI, and wasn't able to replicate the error. The GUI reports that it encrypts successfully? What error message does the CLI give when decrypting? And you're using the -d flag to decrypt in a command like $ ./cloaker_cli -d ~/encrypted_file.cloaker?

logix2 commented 5 years ago

Here's how I used it and the output:

$ ./cloaker_cli -d /home/logix/***********.cloaker
Password: 
Error: Incorrect password

The GUI is able to decrypt the same file using the same password I used with the CLI.

spieglt commented 5 years ago

My only thought so far on this is that maybe your terminal behaves differently from mine and the rpassword library is not stripping the newline or something as a result. I just pushed a branch called no_rpassword that just uses stdin().read_line() and then strips the whitespace, meaning your password will show up in the terminal. Do you mind giving that a try, and maybe pasting from the clipboard in both the GUI and CLI to make sure the password is the same? (And it goes without saying but don't post the output with your password here.)

logix2 commented 5 years ago

It worked with the no_rpassword branch!

spieglt commented 5 years ago

Great news, thanks for following up. I'll read the rpassword source and possibly swap it out for something else in the near future.

spieglt commented 5 years ago

Another thought on this: I may not have been using the proper function from rpassword. I've changed it from rpassword::read_password_from_tty() to rpassword::prompt_password_stdout(). Both work for me so I'm still flying a bit blind here. Will you please try the current CLI on master branch and see if you can decrypt files that were encrypted with the GUI version?

spieglt commented 5 years ago

@logix2 Tagging you on this one as well in case you didn't see, thanks for following up on the other issue.

logix2 commented 5 years ago

This one is fixed as well, thank you!

spieglt commented 5 years ago

Thank you!