Nowadays it is considered a bad practice just to encrypt passwords on their own. Often an arbitrary string (called "salt") is added to every password and then encryption applied. In principle it does not matter in what sequence you are adding "salt" and encrypt. All these combinations are equal in encoding strength:
HASH (Pass & Salt) OR HASH (HASH (Pass)+Salt)) OR HASH (HASH (Pass) + HASH (Salt))
Salt is kept in separate table as plain-text.
Another thing you can do is to encrypt same value several times in a row. Small delay for one user will not be noticeable, but it will increase effort needed to brute force the password.
It is also a good practice to name tables so table names cannot be guessed. It makes blind attacks more difficult when they cannot get table with passwords straight away.
As to a way to encrypt the string.
SQL Server 2000
There no built-in symmetric functions.
There are 2 asymmetric built-in functions: BINARY_CHECKSUM
and CHECKSUM
.
VB
VB gives you already implemented algorithms as well as tools to do your own implementation.
Article referred to by @SuperFunkyMonkey has links to Security.Cryptography Namespace.
Another symmetric algorithm (one you can decode) is Rijndael.
VB6
orVB.NET
? Either way I'm pretty sure that Google will have plenty of results for it. Why must the encryption be reversible anyway? It is usual to just use a one way hash. – Therese