Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvement regarding the manual and the use of OpenSSL (on Windows) #374

Open
chland opened this issue Mar 30, 2024 · 0 comments
Open
Assignees

Comments

@chland
Copy link

chland commented Mar 30, 2024

First a little bit of a disclaimer: i barely/don't know what i'm doing :-) And somebody who actually knows more about this stuff should update the manual. But i thought I leave this here in case somebody else is running into issues.

I tried to use openssl encryption for my backups and stumbled across two problems. The manual says

To encrypt your backups with a cert file you have to create a private key and a certificate pem file.

$ openssl req -x509 -new -days 100000 -key private.pem -out certificate.pem

but this doesn't work as "-key" requires an already existing key-file. So you would basically have to run something like

$ openssl genrsa -out private.pem 4096

first... and then the command from the manual.

Also, if you're using Windows you'll run into an "interesting" secondary problem. The files will be encrypted just fine but if you try to decrypt them using the command from the manual you'll end up with a broken file. The problem seems to be that openssl does something funky with the line-breaks upon decryption.

To fix this, you have to use the "-binary" parameter:

$ openssl smime -decrypt -aes256 -inform DER \
  -in backup.tar.bz2.enc \
  -out backup.tar.bz2 \
  -inkey private.pem \
  -binary

IDK how much of an issue this is when you're using Linux as I only tested it on Windows.

@sebastianfeldmann sebastianfeldmann self-assigned this Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants