Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to protect pic. in blob fields
Message
From
03/10/2011 12:10:41
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01525343
Message ID:
01525475
Views:
46
>I did lots of tests
>
>CHRTRAN() works fine to replace 2 letters at the same time.
>
>
>CHRTRAN (fdados.data,"DF","FD")
>
>revert:
>
>CHRTRAN (fdados.data,"FD","DF")
>
>
>The problem is that it does not seem to work with blob fields, because I tested it in memo field and works fine,
>but not with blob files.

Not familiar with the use of blob fields in VFP so I don't know what the problem may be. But bear in mind that JPG uses a lossy compression. If you encrypt the byte stream before saving as a jpg then the retrieved bytes will not neccessarily match what was encrypted and the decryption will fail.

>The question is:
>If I invert several letters of a picture file, would someone be able to guess the letters ?

There are two parts to that. Anyone attempting to decrypt would first have to correctly guess the method used before attempting to discover which bytes were changed. Obviously the more bytes changed the more complex the task. If, instead of the simple transposition used in my first example, you were to use substitution then that adds another level of complexity.
You could also vary the 'key' for each image and embed that as a few extra bytes after encrypting. e.g using the D->F and F->D example above then insert 'DFFD' at some arbitrary position in the data and retrieve that first to discover the required substitutions.


>It seems to me that a blob would be safer, if it had worked.
>
>When the .jpg is stored into a memo field I have no idea of what all the characters mean and how efficient is to alter them.
>
>I want to hide a bank card (.jpg), and see it as want.
>
>Moises

>>>Try
>>>
>>>REPLACE DATA2 WITH CHRTRAN (data2,"DE","ED")
>>>
>>>-to restore, do it again-
>>>
>>>REPLACE DATA2 WITH CHRTRAN (data2,"DE","ED")
>>>
>>>this is OK if all you want to do is fuzz it up.
>>
>>"fuzz it up"
>>Interesting point. We don't know whether Moises just wants to degrade the image to a point where it is recognizable but un-usable or where he wants to make it completely scrambled in the encrypted state.....
Previous
Reply
Map
View

Click here to load this message in the networking platform