test encryption
Kenneth Brody
kenbrody at spamcop.net
Wed Oct 28 11:28:12 PDT 2009
Richard Kreiss wrote:
> Following Mark's suggestion partly, I came up with this solution:
>
> ──────────────────────────────────────────────────────────────────────────────
> 7 ------- - - - - - - - - - - - - - - - -
> ◄ If:
> Then: sl(2,.0)=strtok(4,"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+=[]{}\|/?,.<>~`","1")
> 8 ------- - - - - - - - - - - - - - - - -
> ◄ If: sl ge "1" 'this is an encrypted value
> Then: GOTO doit
> 9 ------- - - - - - - - - - - - - - - - -
> ◄ If:
> Then: sl="1";val="0"
> 10 ------- - - - - - - - - - - - - - - - -
> Loop_it◄ If: mid(4,sl,"1") = val and sl lt "17"
> Then: sl=sl+"1";GOTO loop_it
> 11 ------- - - - - - - - - - - - - - - - -
> ◄ If: mid(4,sl,"1") ne val 'not a number encrypted value
> Then: GOTO doit
> 12 ------- - - - - - - - - - - - - - - - -
> ◄ If: val lt "9"
> Then: sl="1";val=val+"1";GOTO loop_it
>
> Strtok tests for all of the possible keyboard characters except numbers. If any of these characters are present, got decryption routine.
>
> The next section will test for a number in each position. If it is a number, the value is incremented and the pointer is moved one character right. And the test continues.
>
> Yes, I know that there is no assurance that the encrypted value can't be all numbers. I am using AES encryption for this and have scanned through over 8,000 records in the file and have found none which is all numbers. In some cases a number or numbers are scattered throughout the encryption value. I have yet to see 2 consecutive numbers.
>
> Now, if I was encrypting a million records, who knows.....
I still don't follow your logic here, especially the Loop_it loop.
Have you tried it with "unencrypted" numbers? Does it successfully say
"this is probably unencrypted"?
Given a field 3 with a first character "1", won't your loop immediately go
to "doit"? In fact, I see no field value which would fall through to the
"this is probably unencrypted" code.
Your comment above seems to say you want to test "is every character a number".
If that's the case, why not replace the entire 6-line processing above with:
If: xlate(4,"1234567890","") ne ""
Then: goto doit ' This field is not all numbers -- it's encrypted
--
Kenneth Brody
More information about the Filepro-list
mailing list