Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Lose Chars When Store Encrypted String Inside a ClientDataSet



Permlink Replies: 1 - Last Post: Apr 3, 2017 9:04 PM Last Post By: Jeff Overcash (... Threads: [ Previous | Next ]
Thiago Silva


Posts: 37
Registered: 12/20/04
Lose Chars When Store Encrypted String Inside a ClientDataSet
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 3, 2017 5:22 PM
Hi Everyone,

I am trying to store a encrypted string in a string field inside a clientdataset, but when I assign the value the data is broken. For example, I have a string: "my dog is black and bark alot" then I encryt the string and when store the encrypted contents and decrypted after the string is "my dog" only. Any char is broke the string! How do I store correctly the string? Is it possible? My App is base on DataSnap.

Thanks alot!

Thiago.
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: Lose Chars When Store Encrypted String Inside a ClientDataSet
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 3, 2017 9:04 PM   in response to: Thiago Silva in response to: Thiago Silva
Thiago Silva wrote:
Hi Everyone,

I am trying to store a encrypted string in a string field inside a clientdataset, but when I assign the value the data is broken. For example, I have a string: "my dog is black and bark alot" then I encryt the string and when store the encrypted contents and decrypted after the string is "my dog" only. Any char is broke the string! How do I store correctly the string? Is it possible? My App is base on DataSnap.

Thanks alot!

Thiago.

Odds are your encryption is resulting in a 00 in the bytes, which will be the
null terminator. Either store it in a blob or encode your encrypted string in
something like Base64 which makes sure the result is a string. Encrypted
strings are no longer strings but not an array of bytes and should not be stored
as strings.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02