var unreadAlerts = '1';
You have one unread private message from dkota titled Welcome to the Forum!

OpenSSL 101
#1
Servus! This is DerRoteMilan.

I have been thinking about the kind of threads you guys might enjoy and what came to mind
was: All GUI options for encryption kinda suck.

So I thought let's make a quick cheat sheet thread about how to use the CLI of OpenSSL to do some
common tasks. No bulk, no bad looking Qt-Interface, no spyware added, just plain OpenSSL.

RSA:
To generate a private rsa key with 8198 bytes in size you can use the following command:
Code:
$ openssl genrsa -out private_key.pem 8198

To create the public key, that you can share everywhere, from the generated private key, you can use:
Code:
openssl rsa -in private_key.pem -out public-key.pem -outform PEM -pubout

To encrypt a file using someones public key you can use:
Code:
$ openssl rsautl -encrypt -inkey public-key.pem -pubin -in file.txt -out file.txt.rsa

To decrypt something that was encrypted for you, meaning with your public key, use:
Code:
$ openssl rsautl -decrypt -inkey key.pem -in file.txt.rsa -out file.txt

Hashing:
hash values are often used online to ensure a file you downloaded was not modified by someone else than the author
or also to make sure it has not been corrupted during network transfer.

Here are some of the most common commands or algorithms used for that:
Code:
$ md5sum <file>
$ sha1sum <file>
$ sha256sum <file>
$ sha512sum <file>

Symmetric Encryption:
To encrypt a file using a password AES is commonly used. You can use the following command for that:
Code:
$ openssl aes-256-cbc -e -a -in file.txt -out file.aes
:
Note here:
- -a will output base64 encoded
- The user will be prompted for a password, it is not specified as a command line argument

To decrypt the file using the same password again, use:
Code:
$ openssl aes-256-cbc -d -a -in file.aes -out file.txt : decrypt a file using aes

Thanks for reading!
Hope this thread has been helpful to some of you.

I have 2 other more in depth threads in the making about RATs and about binary exploitation.
Let me know what kind of topic you would like me to write about!

Also let me know about the style of the Thread.
Do you like it short and snappy or would you like more prose text to go along with it.

Feel free to have a chat with me also: derrotemilan@xmpp.is
Report


Quick Reply
Message
Type your reply to this message here.





Users browsing this thread: purely_cabbage
var thread_deleted = "0"; if(thread_deleted == "1") { $("#quick_reply_form, .new_reply_button, .thread_tools, .inline_rating").hide(); $("#moderator_options_selector option.option_mirage").attr("disabled","disabled"); }