I saw last night a nice post on Francois Degrelle's blog titled "How to encrypt/decrypt strings with the dbms_obfuscation_toolkit package
" that gives some nice example PL/SQL package that includes two functions, one to encrypt, one to decrypt a varchar2 string. The functions use the DBMS_OBFUSCATION_TOOLKIT DESEncrypt and DESDecrypt procedures. Although this package is now old hat and has been replaced by the better DBMS_CRYPTO in 10g. The example shows the problems of padding to 8 characters although doesn't show how to deal with encrypting different data types. Nice example.