1

I wish to encrypt an Unicode string by using bitwise operators from my client (Dart) app, and send it to my PostgreSQL server where a function will decrypt it by using bitwise operators. But I don't find any info to respect, is it possible?

NOTE: with Dart I can convert a string into codes and they can be dealt with bitwise operators.

1 Answers1

0

So you receive a string of bytes which has postgresql type bytea,

Perform your bitwise operations on that

using built in bytesting operations. https://www.postgresql.org/docs/15/functions-binarystring.html or using pgcrypto https://www.postgresql.org/docs/current/pgcrypto.html

Then use convert_from( mangled_bytestring,'UTF8') to convert it to unicode text.

text (and varchar etc) in postgresql is represented internally as UTF8 but this is well hidden from the user.

Jasen
  • 3,656
  • 1
  • 15
  • 17