|
Hello Michael,
You'd want to tag the physical file field with a CCSID(65535)
keyword, to avoid possible conversion issues relating to treating the
data as text - as opposed to the binary value a cipher stringrepresents.
Judged by your description of the problem another more immediate
concern would be how you preserve the actual length of the cipher
string. You have to feed back the exact same string length to the
decryption process as you received initially from the encryption
process. So if you receive a cipher string with a length of 192
bytes, store that value in a fixed field in your physical file having
a length of f.x. 512 bytes, you'll need some way to ensury that
you're only passing the actual 192 bytes cipher string back to the
decryption process. Simply running a %Trim() against the file field
is not a recommended method of obtaining the cipher string length, as
there's a possibility that the encryption process returns the valuex'40' as the two rightmost nibbles.
Best regards,
Carsten
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Michael Ryan
Sent: 24. april 2008 14:09
To: Midrange Systems Technical Discussion
Subject: Encrypted Data to File
I've implemented Carsten Flensberg's service program to encrypt and
decrypt data using the Cryptographic APIs. Works well. However, I'm
having a problem writing to/reading from a physical file containing
the encrypted data. I encrypt some data into a 1024A varying field,
put the varying length field into a (smaller) fixed length field in
the database, and then in a later process, read the encrypted data
and attempt to decrypt it. I get a value back of blanks from the
decryption, though I can see (in debug) that the encrypted data is
there. If I don't move the encrypted data into the physical file
field, I'm able to encrypt and decrypt. So it must be the physical
file move that's causing the problem. Has anyone encountered this?
What's the fix?
Thanks!
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives athttp://archive.midrange.com/midrange-l.
--
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
take a moment to review the archives at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.