Home > database >  A BAS codes defined for solution
A BAS codes defined for solution

Time:09-17

Code:
The Public function string of_decode (string as_text, string as_key);
String ls_encode
String ls_c0d0
String ls_c0
String ls_d0
String ls_k [16]
String ls_k2 [16]
The integer pc1 []
The integer pc2 []
The integer I
String ls_key
The integer k
String ls_text
String ls_64bit

Ls_key=of_getkey (as_key)
57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4 pc1={}
14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32 pc2={}
Ls_c0d0=of_trans (pc1, ls_key)
Ls_c0=left (ls_c0d0, 28)
Ls_d0=right (ls_c0d0, 28)
FOR I=1 TO 16//6
IF (((I=1 OR I=2) OR I=9) OR I=16) THEN//7
Ls_c0=of_left_trans (ls_c0, 1)
Ls_d0=of_left_trans (ls_d0, 1)
The ELSE//7
Ls_c0=of_left_trans (ls_c0, 2)
Ls_d0=of_left_trans (ls_d0, 2)
END the IF//7
Ls_c0d0=ls_c0 + ls_d0
Ls_k [I]=of_trans (pc2, ls_c0d0)
NEXT//6
FOR I=1 TO 16//16
Ls_k2 [I]=ls_k [17 - I]
NEXT//16
Ls_text=trim (as_text)
IF len (ls_text)=0 THEN//20
RETURN ""
END IF//20
Ls_text=of_16to2 (ls_text)
K=mod (len (ls_text), 64)
IF k & gt; 0 THEN//24
FOR I=1 TO (8) (64 - k)///25
Ls_text ls_text +="0010000"
NEXT//25
END IF//24
FOR I=1 TO (len (ls_text)/64)//28
Ls_64bit=mid (ls_text, ((I - 1) * 64) + 1 ()
Ls_encode=ls_encode + of_cryptograph (ls_64bit ls_k2)
NEXT//28
Ls_encode=trim (of_tostring (ls_encode))
RETURN ls_encode
End the function

Of_getkey:
Protected function string of_getkey (string as_key);
The integer li_i
The integer li_asc
String ls_key
String ls_binary
Long ll_key


IF (isnull (as_key) OR len (trim (as_key))=0) THEN//0
FOR li_i=1 TO 64//1
Ls_key=ls_key + string (mod (li_i, 2))
NEXT
RETURN ls_key
END the IF
FOR li_i=1 TO len (as_key)//5
Ll_key +=asc (mid (li_i as_key, 1))
NEXT
Ls_binary=of_binary (ll_key)
Ls_key=ls_binary
FOR li_i=1 TO (64 - len (ls_binary))//10
Ls_key=ls_key + string (mod (li_i, 2))
NEXT
RETURN ls_key
End the function

Another decoding definition of_des (code, use less than, so not on)
The Public function string of_des (string as_string, integer ai_dec, string as_factor);
String ls_return

IF ai_dec=1 THEN//0
Ls_return=inv_des. Of_encode (as_string as_factor)
The ELSE//0
Ls_return=inv_des. Of_decode (as_string as_factor)
END the IF//0
RETURN ls_return


Call:
Ls_temp=inv_regnet. Of_des (ls_temp, 1, ls_factor)
The statement in other programs running on normal, when transplanted into other programs, an error is: the null object reference
To solve?

CodePudding user response:

Ls_c0d0=of_trans (pc1, ls_key)
In an error. Should be ls_key no value is returned.
  • Related