There are many algorithms to encrypt passwords.
But it depends on your application usage to use which one.
For example if you have contract with DOD it should be very secure. Anyway here's an example.
Password is "siavosh"
We have a table that keeps a number for each character.
Code:
{a = 3 , b = 33,..., s = 2, o = 112 , i = 25, v = 12, h = 433 }
So siavosh will be 2253121122433
It is the simplest possible algorithm and very easy to decrypt for an expert.
[off topic] At last this code tag script has been enabled? What a bad news, what a bad script.