I’d like to encrypt the data in my DataMatrix barcode but am unable to make the round trip. On the encoding side I have:
Dim s As String = DefineEncoding(TextToEncode,encodings.UTF8)
s = BlowfishMBS.Encrypt("kMyKey", s) // s is a byte sequence
s = EncodeBase64(s) // s is a "string"
Dim b As new BarcodeGeneratorMBS
b.Symbology = b.BarcodeDatamatrix
b.encode s
and on the decode side after scanning into a TextArea:
Dim s As String = DecodeBase64(TextArea1.Text)
s = BlowfishMBS.Decrypt("kMyKey", s)
s = DefineEncoding(s,encodings.UTF8)
OutputText = s
It works if I remove the barcoding and scanning parts, but after printing and scanning, the output is unprintable binary string data.
The scanner is a Zebra DS2208 emulating a keyboard.
I’d think that the Base64-encoded strings wouldn’t confuse the scanner or the OS keyboard interface or TextArea or BarcodeMBS, but maybe that’s an unfounded assumption.
9 posts - 6 participants