You could use an MD5 hash.. do you need to be able to decrypt it or is it simply to create a unique identifier?
Or, you could convert the output to HEX then you'd have no dodgy characters.
If you're looking to encrypt for the purposes of security, then you need to make a careful choice about the algorithm (DES for example, would not be considered acceptable for most applications because it can be easily cracked).