read -s PASS; echo $PASS | convert sensitive.jpg -encipher - -depth 8 png24:hidden.png

encrypt sensitive image using password

Do not use JPEG, GIF, or any other 'lossy' image encoding with Encryption

0
By: kev
2011-11-25 18:15:23

These Might Interest You


  • 0
    gpg -c sensitive.txt; gpg sensitive.txt.gpg
    evandrix · 2012-09-05 22:52:26 0
  • Need to encrypt something from the command line? I've used this before to encrypt passwords with a master password that was shared amongst a team. To decrypt: ~$ echo -n 'jA0EAwMCPdknsznAww5gySL1/quqhXg6QgQkIz5abzGP5EZgTbXCFU+y6dP8ySWovytc' | base64 --decode | gpg --decrypt gpg: CAST5 encrypted data Enter passphrase: secret gpg: encrypted with 1 passphrase HelloWorld! Show Sample Output


    0
    echo 'HelloWorld!' | gpg --symmetric | base64
    ryanchapman · 2013-07-06 08:30:35 0
  • The password is stored in the password file, which obviously must be kept secure, encrypted later with gpg, deleted, or whatever you prefer. To decrypt: openssl enc -d -aes-256-cbc -salt -in filename.enc -out filename -pass file:/path/to/password-file Alternative ciphers can be used, of course.


    2
    for f in * ; do [ -f $f ] && openssl enc -aes-256-cbc -salt -in $f -out $f.enc -pass file:/tmp/password-file ; done
    jasonjgw · 2010-11-20 03:29:16 2
  • This command line creates a new user with home directory, using the command "useradd". The command "mkpasswd" lets you encrypt the password e.g. with SHA-512 method. This line ensures that your password is written encrypted in /etc/shadow" so you can log in with the new user. Show Sample Output


    0
    useradd -m -s /bin/bash -p $(mkpasswd --hash=SHA-512 password) username
    miko · 2013-03-22 10:46:03 0
  • This CLI aims at uploaded a image file (PNG, JPEG, GIF...) to the Web 2.0 Twitpic service (http://twitpic.com/). A valid Twitter account is needed. Show Sample Output


    0
    curl -F "username=mytwiterlogin" -F "password=mytwitterpassword" -F "message=My image description" -F media=@"./image.png" http://twitpic.com/api/uploadAndPost
    Nicolargo · 2010-03-26 12:20:04 0
  • Now a bit of explanation required for this command.Once you type the command it opens up an vi editor with an temporary file enlisting the password file information .So if you make an change it will not reflected in the passwd file until you save the file.The reason behind using this command over other way to view the password file in network environment is that it locks the password file when you start working with it.So no one can temper with it during that period.Once you are done(means you save the tmp file) ,it will release the lock associated with it.I think it's a better mechanism to view the sensitive data like passwd file.Never ever use other tool like cat, nano or any other means. Show Sample Output


    -3
    vipw
    unixbhaskar · 2009-08-29 03:46:42 0

What Others Think

to decrypt: echo pa33w0rd | convert hidden.png -decipher - sensitive.png
kev · 338 weeks and 2 days ago
How can I decrypt encrypted image ?
mesuutt · 338 weeks and 1 day ago
Now the password is in plain text in the history.
Fudo · 338 weeks and 1 day ago
Now it's not :-)
Fudo · 338 weeks ago
:)
mesuutt · 337 weeks and 3 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: