Re: RATECRYPT() Version 1.2 included below
- From: bill robertson <arcadia2@xxxxxxxxxxxxx>
- Date: Fri, 18 Aug 2006 19:21:02 GMT
Mel Smith wrote:
Dear Friends,Hi Mel
Here is Version 1.2 of RateCrypt() below.
Perhaps you will be interested in a mathematically equivalent version of your routine. I took the rand1.prg function as you did and scaled it so that it would generate numbers in the 60000 - 99999 range that you wanted to use. The method uses no round() function and like the xor function requires no separate encrypt/decrypte routine.
It is as secure as the rand1() function which isn't all that secure but certainly should suffice to obscure the rate. It might be slightly more secure if the EmpNo was a prime number. Some of the lines may wrap but I cut and pasted so it should compile OK and show you some typical results for a fixed rate of 12.50
/*----------------------------------------------------------*/
#define nMin 60000
#define nMax 99999
#define nOrg 1234
Function main()
LOCAL nRow:= 1, nCol:= 0
LOCAL nRate:= 12.50, nEmpNo:= 21343
Clear screen
While nCol < 80
@ nRow++, nCol say ( nRate:= ft_rand1( nRate, nEmpNo ) ) Picture "#####.##"
@ nRow++, nCol say ( nRate:= ft_rand1( nRate, nEmpNo ) ) Picture "#####.##"
++nEmpNo
If nRow > 20
nRow := 1
nCol += 10
END if
END while
return nil
function ft_rand1(nRate, nEmpNo)
LOCAL nSeed:= nOrg + nEmpNo
LOCAL m := 100000000, b := 31415621
LOCAL nDiff:= nMax - nMin
Return Int(nMin+nDiff*((nSeed:=(nSeed*b+1)%m))/m)-nRate
.
- Follow-Ups:
- Re: RATECRYPT() Version 1.2 included below
- From: Mel Smith
- Re: RATECRYPT() Version 1.2 included below
- References:
- Re: Encryption ??
- From: Mel Smith
- Re: Encryption ??
- From: pete
- Re: Encryption ??
- From: Mel Smith
- Re: Encryption ??
- From: Norman Perelson
- My Completed RATECRYPT() function included below
- From: Mel Smith
- Re: My Completed RATECRYPT() function included below
- From: bill robertson
- Re: My Completed RATECRYPT() function included below
- From: Mel Smith
- Re: My Completed RATECRYPT() function included below
- From: bill robertson
- Re: My Completed RATECRYPT() function included below
- From: Mel Smith
- RATECRYPT() Version 1.2 included below
- From: Mel Smith
- Re: Encryption ??
- Prev by Date: RATECRYPT() Version 1.2 included below
- Next by Date: Blowfish encryption
- Previous by thread: RATECRYPT() Version 1.2 included below
- Next by thread: Re: RATECRYPT() Version 1.2 included below
- Index(es):
Relevant Pages
|
Loading