Encrypt dan Decrypr pada foxpro

Wah teknik ini penting untuk mengaman saat login OK saya akan berbagi silahkan copas aja dah


FUNCTION ENCRYPT
 PARAMETER cpass, mode
 PRIVATE cencrypt
 cencrypt = ''
 cpass=ALLTRIM(cpass)
 DO CASE
 CASE mode = 1        && Encrypt
 FOR i = 1 TO LEN(cpass)
 N   = TRAN(i,'@L 99')
 H&N = CHR(ASC(SUBSTR(cpass,i,1))+80)
 ENDFOR

FOR j = 1 TO LEN(cpass)
 N   = TRAN(j,'@L 99')
 cencrypt = cencrypt + H&N
 ENDFOR

CASE mode = 2        && Decrypt
 FOR i = 1 TO LEN(cpass)
 N   = TRAN(i,'@L 99')
 H&N = CHR(ASC(SUBSTR(cpass,i,1))-80)
 ENDFOR

FOR j = 1 TO LEN(cpass)
 N   = TRAN(j,'@L 99')
 cencrypt = cencrypt + H&N
 ENDFOR
 ENDCASE
 RETURN cencrypt

cara pemakaian fungsi di atas adalah

Fungsi    : ENCRYPT(<C1>,<N1>)

Paramater :

C1 = character yang akan di-encrypt/di-decrypt
N1 = Mode ( 1 = Encrypt , 2 = Decrypt )

OK moga bermanfaat😀

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: