Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

crypt and decrypt function

Status
Not open for further replies.

fordraiders

Programmer
Oct 31, 2001
1
US
To All,
I have the following cd.prg file crypting two fields in my clipper table.
cattest2.dbf

******** start code ********
use cattest2
? time()
do while .not. eof()
? recno()
cmfrnum = cattest2->mfrnum
cvar := crypt("&cmfrnum", "brittany18monthsalex")
replace cattest2->mfrnum with cvar /*rypt("cmfrnum", "brittany18monthsalex")*/
cwwgmfrnum = cattest2->wwgmfrnum
Cvar2 := crypt("&cwwgmfrnum", "dietra25yearsmichelle")
replace cattest2->wwgmfrnum with cvar2 /*rypt("cwwgmfrnum", "dietra25yearsmichelle")*/
skip
enddo
? time()
goto top
@ 25, 30 say 'three of five functions down'
index on cattest2->mfrnum to cattest2
? TIME()
INDEX ON CATTEST2->ITEM TO ITEM
? TIME()
close all
quit
********** end code **********


PROBLEM:
I'am trying to reverse the crypting by decrypting the fields again with this code.

********** start code *********
use cattest2
? time()
do while .not. eof()
? recno()
cmfrnum = cattest2->mfrnum
cvar := decrypt("&cmfrnum", "brittany18monthsalex")
replace cattest2->mfrnum with cvar /*decrypt("cmfrnum", "brittany18monthsalex")*/
cwwgmfrnum = cattest2->wwgmfrnum
Cvar2 := decrypt("&cwwgmfrnum", "dietra25yearsmichelle")
replace cattest2->wwgmfrnum with cvar2 /*decrypt("cwwgmfrnum", "dietra25yearsmichelle")*/
skip
enddo
? time()
goto top
@ 25, 30 say 'three of five functions down'
index on cattest2->mfrnum to cattest2
? TIME()
INDEX ON CATTEST2->ITEM TO ITEM
? TIME()
close all
quit

************ end code **************

What I get is a partial decryption and the original cryption is still in the field.

example:

@#$%^

After code

3456@#$%^

I DO NOT NEED the original cryption code still in the field.

Thanks
fordraiders

 
You have any error:

cVar := "Este es un texto de prueba"
? cvar2 := crypt(cvar, "text")
? decrypt(cvar2, "text")

you have this:
crypt("&cwwgmfrnum", "dietra25yearsmichelle")
That is BAD!!!! WRONG!!!!

This is correct
crypt(cwwgmfrnum, "dietra25yearsmichelle")

Ramon Zea
i wait help you
 
Respected sir
i have one dbf with this format and i want to convert into original form Kindly advice me the coding how to do it


TEL_NO SURNAME_CO FIRSTNAME INITIALS TITLE STREET STREET_NO BLDG LOCALITY PINCODE CITY POSITION DESIG SURNM_GRP ABBR_ADDR
5hj9996 D@F^F#F]ªèéUF`Vª_3*38@^:$:?@^#@:^%)%* #@:^%)%*@,^,#,1@^3* #@: #@:^%)%*@, YéûnNRYKñö]^X,1@^3*38 4é:;%)%*@, #@:^%)%*@,^,#,1@^3*38 E@~^I&GKÄ,G,#,1@^3 :`ZÄ50 FéÆ^Z^YK@,^ 0 #@:^%) #@:^%)%*@,^,#,1@^3*38@^:$:?@ D@F^F#F]ªèé[?`Vª2pT)iY£v~n[[q¿ôR«:zWK%PÿÉV94,1@^3*38@^:$:?@
9p\:9:; E@F]F"GZ@,],"+2@]3)29@]:#9@@]$@:]%($+ $@:]%($+@,],"+2@]3) $@: $@:]%($+@, [èáv%OLZª|^\?]S@éü3)29 6b:%($+@, $@:]%($+@,],"+2@]3)29 E¬óèUYV+@,],"+2@]3 ;h`178 6h:pFTKL£nç 0 $@:]%( $@:]%($+@,],"+2@]3)29@]:#9@@ E@F]F"GZTPé1^Pe¿ç[Lea@p~:U]@élnLáñè%0FS¿>e,"+2@]3)29@]:#9@@
9ll::8< F@F\G&quot;PQ¿nï,JXW¬äòeOVm@né:KfeÆDI%@:\%'#, %@:\%'#,@,\,!*3@\3( %@: %@:\%'#,@, R¬éèFML,ñt[,!*3@\3(1: Sd^É%'#,@, %@:\%'#,@,\,!*3@\3(1: Lé&#8359;]JS#^èndT&quot;*3@\3 <`Zî73 HéÆ\Z\WM@,\ 0 %@:\%' %@:\%'#,@,\,!*3@\3(1:mad:\:&quot;8A@ F@F\G&quot;PQ¿nï,JXW¬äòeOVm@né:KfeÆDSSd^É*LXPÆnue&\WJ8xG&quot;1:mad:\:&quot;8A@
8h\388: G@F[I#C`ªèUC]Yª\3'0;@[:!7B@[&@:[%&&quot;- &@:[%&&quot;-@,[, )4@[3' &@: &@:[%&&quot;-@, HÆépFN&quot;`é,8, )4@[3'0; 8`f{%&&quot;-@, &@:[%&&quot;-@,[, )4@[3'0; Hè|dTO&quot;`¿,^, )4@[3 =`Zï52 IéÆ[Z[VN@,[ 0 &@:[%& &@:[%&&quot;-@,[, )4@[3'0;@[:!7B@ G@F[I#C`ªèUC]Yª2nC35]ÆXp[I7uéIY¿:äQP&quot;_^êy=)6J@[3'0;@[:!7B@

Kindly mail me at pradeep_ch_das@yahoo.com

with regrads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top