Someone linked to this:
http://www.iancrt.co.uk/PureBasic/des.pb.txt
But that site is gone...
I think I need the original DES encryption, not the 3DES algorithm, but both would be nice anyway.

Because that is a one way HASHing function. He is talking about DES (En/De)cryption.But a question: PureBasic has a DESFingerPrint() command, so why not use that?



Code: Select all
$lefttemp = $pc2bytes0[$left >> 28 & $masks[28]] | $pc2bytes1[($left >> 24 & $masks[24]) & 0xf]yes >> & | behave the same just use brackets, something like thisJoakim Christiansen wrote: But how on earth do I write something like this in PB?Well, mostly I wonder about the " >> & | " part, does they work the same in PB?Code: Select all
$lefttemp = $pc2bytes0[$left >> 28 & $masks[28]] | $pc2bytes1[($left >> 24 & $masks[24]) & 0xf]
And numbers like "0x1010400" and "-0x7fef7fe0" how do you write those in PB?
Code: Select all
lefttemp = (pc2bytes0((left >> 28) & masks(28)) | pc2bytes1(((left >> 24) & masks(24)) & $f))
Code: Select all
$1010400 $7fef7fe0

Code: Select all
Private Const ALG_CLASS_DATA_ENCRYPT = 24576
Private Const ALG_CLASS_HASH = 32768
Private Const ALG_TYPE_ANY = 0
Private Const ALG_TYPE_BLOCK = 1536
Private Const ALG_TYPE_STREAM = 2048
Private Const ALG_SID_RC2 = 2
Private Const ALG_SID_RC4 = 1
Private Const ALG_SID_MD5 = 3
Private Const ALG_SID_DES = 1
Private Const CALG_MD5 = ((ALG_CLASS_HASH Or ALG_TYPE_ANY) Or ALG_SID_MD5)
Private Const CALG_RC2 = ((ALG_CLASS_DATA_ENCRYPT Or ALG_TYPE_BLOCK) Or ALG_SID_RC2)
Private Const CALG_RC4 = ((ALG_CLASS_DATA_ENCRYPT Or ALG_TYPE_STREAM) Or ALG_SID_RC4)
Private Const CALG_DES = (ALG_CLASS_DATA_ENCRYPT Or ALG_TYPE_BLOCK Or ALG_SID_DES)Thank you for doing this. I have no immediate need, but as I am doing more and more is Linux, I have the need to get off of the Windows API. Anything that does that for me is a plus. It's been added to my code repository. Great work.coco2 wrote:*epic bump*
I have one now... I noticed your post before I made it to check it wasn't already done![]()
http://www.purebasic.fr/english/viewtop ... 41#p445741