Re: RATECRYPT() Version 1.2 included below



Mel Smith wrote:
Dear Friends,

Here is Version 1.2 of RateCrypt() below.
Hi Mel

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
.



Relevant Pages

  • Re: Capture Pswrd & Userid To Auto Populate Form
    ... I need to capture the userid and name at the password sign-in level. ... > Does anyone have a routine or code for this? ... Have you considered implementing built-in Access User Level Security? ... It is much more secure than creating something yourself and you have a lot ...
    (microsoft.public.access.formscoding)
  • Re: Securing hashing algorithm
    ... We are using an already verified *good* algorithm but have added "spice and ... This was done to make the routine "slow" enough to ... So how do I secure my hashing routine? ...
    (microsoft.public.dotnet.languages.csharp)

Loading