NegativeSpace Posted March 2, 2013 Share Posted March 2, 2013 I am trying to figure out how to encrypt a string of text in BASh by inputting plain text (in English) and a key string. There are plenty of ways and instructions out there on how to encrypt and decrypt files from the command line but I do not want to use files. I know there are more elgant solutions for AES encryption of text but I have found that using GUI software is much too slow and involved for my needs most of the time. So what is the secret to inputting a couple sentences, inputting a key string, and getting the AES encrypted version of the text in the print? I can't believe I am not able to find any instructions for this after 30 minutes of searching google! It seems to me like a lot of people would want to know how to do this. Quote Link to comment Share on other sites More sharing options...
no42 Posted March 2, 2013 Share Posted March 2, 2013 (edited) Two programs come to my mind: aespipe aesutil Demo of aesutil: $ /opt/local/bin/aes -e -b -s "Encrypted me" -p password hq6kK1M5d5x45DCF7pmELXUzW3ARHV9A/zJcTw== $ /opt/local/bin/aes -d -b -s "hq6kK1M5d5x45DCF7pmELXUzW3ARHV9A/zJcTw==" -p password Encrypted me $ flags: -e encrypt -d decrypt -b base64 encode/decode (otherwise you get non-printable chars) -s this_string (blank for stdin) -p the encryption/decryption password Edited March 2, 2013 by midnitesnake Quote Link to comment Share on other sites More sharing options...
NegativeSpace Posted March 2, 2013 Author Share Posted March 2, 2013 Two programs come to my mind: aespipe aesutil Demo of aesutil: $ /opt/local/bin/aes -e -b -s "Encrypted me" -p password hq6kK1M5d5x45DCF7pmELXUzW3ARHV9A/zJcTw== $ /opt/local/bin/aes -d -b -s "hq6kK1M5d5x45DCF7pmELXUzW3ARHV9A/zJcTw==" -p password Encrypted me $ I checked out aespipe but it doesn't seem to support encryption of text directly input into the command line but, rather, only supports encrypting files and some other options. I haven't heard of aesutil. That seems to be much closer to what I need. I will try that out, if I can understand the man pages that is. I'm still not very efficient with the CLI but hopefully I can figure it out and make it work. Quote Link to comment Share on other sites More sharing options...
logicalconfusion Posted March 18, 2013 Share Posted March 18, 2013 seems like you'd have to write a script to load every time you open a CLI and then parse the "text directly input" to AES cmd utilities. Quote Link to comment Share on other sites More sharing options...
digip Posted March 18, 2013 Share Posted March 18, 2013 I know they have things built into a lot of systems like md5sum, so there might be an already built tool for what you want to do the same thing with other cryptography or cat a file to a text document with password, into a crypted file etc and vice versa. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.