What would be the most practical way to protect (from reading, or better to say, understanding the contents) a text file in a way that can be done from the command line?

It is a normal text file containing notes, but which will pass, let's say, through an unlimited number of hands, but needs to be accessible to only a few.
It is actually a bit more complicated, but this is the gist of it.

The only solution I thought of so far would be to password protect it in an archive, but how safe is that? And it's not all that practical to do from cmd. I'm still keeping it as an option in reserve ...

All other suggestions welcomed!

4 Answers 4


You should simply use an encryption program that is open source, proven and widely accepted by the security community. One example is PGP.

If you do it properly and don't do something silly you should not have to worry about being hacked.

  • 1
    +1 I have never worked with PGP. Do you know of a command like program, that has a relatively simple interface for doing things like this?
    – Rook
    Jan 6, 2012 at 13:11
  • @Idigas: GPG is a command-line PGP implementation.
    – josh3736
    Jan 6, 2012 at 15:18

You're better off using something like TrueCrypt (Cross Platform and Free) to make a secure encrypted container. This container can be of any size and passed on to other people. The TrueCrypt program will mount this container as a Local Disk drive and in it can contain your text file. Give the password used to encrypt the container to anyone who is authorized to view/edit the file.


Command Line Usage


  • 3
    TrueCrypt is just one way of password protecting, which you claim is useless. Please correct your answer.
    – Rotsor
    Jan 6, 2012 at 5:03
  • From Wikipedia: "Zip supports a ... encryption system which is ... known to be seriously flawed". Using a seriously flawed algorithm is never a good idea. You can use rar or any other archive format which uses a not-yet-known-to-be-seriously-flawed encryption algorithm. Again, TrueCrypt is just one of many options for password protecting your files.
    – Rotsor
    Jan 6, 2012 at 13:09

Just use an encrypted notepad replacement such as locknote - its portable so you're sharing one file still, and you can pass the password to the person who is running the system. You'd need to find some way of exchanging the password, of course, but its secure, simple and would work across systems.


Trucrypt creates an encrypted volume. Axcrypt is used to encrypt a single file or folder.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .