About hidden files
The dot-before-file name trick is just a standard Unix convention: a file name starting with a dot is a hidden file which should not be shown through the user interfaces. However, in most of these UIs there is a way to make these files seen. Using the trick may hide the file from most people, but may make it much more obvious to computer gurus.
About encryption
Modern encryption are based on mathematical hypotheses that a certain class of operations cannot be easily undo unless you know exactly how they're done in the first place. This prevents reverse engineering and crypt-analysis. Thus encryption algorithms can be standardized and published for public scrutiny.
To still protect your data, the steps in the algorithms accepts parameters which are derived from a encryption key. A decryption algorithm will also be provided that will only work if the original encryption key is given. If the wrong key is used, the decrypted text will be gibberish. Most of these encryption algorithm suites also comes with mathematical proofs that no other practical algorithms can be used to decrypt the data without knowing the encryption key.
About hasing
A secure hash function is a one-way function, i.e. can't be reversed, with some extra guarantees on its properties. They are not really used for "encryption" but for "proof".
The method you used to "encrypt" passwords in PHP is probably a hash function and it's not really encryption because as you know the point is the hashed data cannot be decrypted.
People often confuse the two because a) many ciphers can be used as hashing functions and b) hashing is also used in encryption suites to make it more secure.
More on b):
Hashing is most often used to treat encryption keys to make the input uniform and avoid known weakness. Thus in more professional encryption software, you'll often be given a choice on both the encryption algorithm (AES, RC4, etc.) and the hash algorithm (MD5, SHA, etc.)
However, you obviously cannot use a hash function to encrypt things because the point of useful encryption is that you can get the clear text back.
To make these knowledge practical
... you'll have to think carefully about who you're trying to hide the data from, how good are their computer skills and will the data be worth it for them to get an expert.
If you can accept people finding the encrypted files but still not be able to open them, any encryption software will probably do. If you want denial of existence, i.e. people cannot prove you have the encrypted file without you giving up the knowledge, you may look into TrueCrypt.
1An easier way to prevent a single command from being entered in the history is to precede it with a space. Another option to prevent an entire session to be saved is to use the command
HISTFILE=
(which tells the shell to save its history ... nowhere). – Gordon Davisson – 2012-01-21T18:52:19.540@GordonDavisson: Indeed. Good point! Thanks for mentioning this. – Karolos – 2012-01-21T19:55:47.550