Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trying to protect pic. in blob fields
Message
De
01/10/2011 13:17:01
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01525343
Message ID:
01525347
Vues:
65
>Viv
>
>Thank you for clarifying.
>
>It was really all fuzzy in my mind.
>
>Should I convert all D to E and E to D at the sametime ?
>
>Or there is no sense in it ?
>
>Any hint to do this encrytion and decryption ?
>
>
>Moises
>
>
>
>
>
>>>Hi
>>>
>>>I stored a picture in blob field and I am testing codes below:
>>>
>>>REPLACE DATA2 WITH STRTRAN (data2,"D","E")
>>>
>>>The picture becomes fuzzy ( OK)
>>>
>>>REPLACE DATA2 WITH STRTRAN (data2,"E","D")
>>>
>>>Then, picture became yet more fuzzy.
>>>
>>>Why picture does not go back to normal ?
>>>
>>>I already tried CHRTRAN
>>
>>If there are 'E's in the string already then you're going to end up converting a lot of the original 'E's to a 'D' so you don't get what you started with:
>>
>>ABCDE
>>D => E
>>ABCEE
>>E => D
>>ABCDD
>>
>>What are you trying to achieve?

There are probably plenty of third party encryption options. But if you wanted something simple along the lines you were thinking maybe:
s1=""
for x = 0 to 255
  s1=s1+Chr(x)
endfor

s2 =  Chr(255)+substr(s1,1)

plain = "Thisisatestofscrambling"

scrambled = CHRTRAN(plain,s1,s2)
unscrambled = CHRTRAN(scrambled,s2,s1)
Disclaimer : crude and not really tested :-}
UPDATE: just modified it a bit :-}
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform