crypt_str should be a string returned from ENCODE().
mysql> mysql> select decode(encode("text","password"),"password"); +----------------------------------------------+ | decode(encode("text","password"),"password") | +----------------------------------------------+ | text | +----------------------------------------------+ 1 row in set (0.00 sec) mysql>