Hi,

Does anyone have experience with storing encrypted data into pgSQL? I have a pgSQL database which uses UTF8 encoding. I am encrypting plain text in my (GUI) application and sending it to a field (with data type 'text') in my database.

I get an error back saying "invalid byte sequence for encoding UTF8; oxd733"

I am using blowfish at 128bit to encrypt the string.

The encrypted string comes out looking like this

Salted__ë±9r™LZPÃOG¤u–¨ékTz~6Ëpi™|O +Lϰ‹r°ô9•mµ�á%€©õP{:‚Àªd
îX@ûñÙÁl£ðŒ…¢53P9×ð“á6kUÆ¢÷ÍìMNÉA•—ä![ˆj”Ø|¨\X–ÛÜu�ªÅÜ-ÎáBæºñȦbF >\Žv/ÞÎ.&ó«[=bný�Kr°óË2U×ZI©âVc°sn=¤Õg«^q0Ã8ý<Êh�;”¨"�[Šç+u[£    –è—=‘±ú3³�ì¯,[EMAIL PROTECTED]‘T¸œÖgœËPÛ<…H—8ÃbÙÉŽNÙí>ÇL]í¶²–âŒÿ/Ínz¶å
Õ?Îcµˆ$í¿W-™óà¢ey÷àÞ¬œ¤CðÏjX”ÃGÄ„·º?ë0L‘هƞ‹&ˆ{ªìëá/Ç}k9?ÄX1⋲T½Hõ5Ôgÿ§yÈy…_—ú$lA~©î1úëùññðÑÝŠžgÕþÊ/«¦…8�¯þ    >ü‚ƒ€–aÈÉ„iG‰}¹²#À


I enclose that in single quotes and send it in an insert statement to pgSQL.

The statement has been working, until I got to a string that generated the above encrypted data, then it broke.

Alternatively, can anyone suggest an encryption algorithm that will only return characters that are valid UTF8 encoded?

Thanks in advance

John T


Reply via email to