Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
I have seen the various resources in the 'database'. Can someone explain to me how basic encryption is done. What are the basic principles? (I am talking about very simple stuff. 'Newbie' comments appreciated.
It works like this:
To Encrypt:
CipherText = PlainText XOR PassKeyTo Decrypt:
PlainText = CipherText XOR PassKey
The XOR truth table is as follows, with the columns being Input A, Input B and the result of A XOR B:
0 0 0 0 1 1 1 0 1 1 1 0If you apply this to the bits in each byte of the plain text & passkey that are being operated on together in an XOR operation, you get the basix XOR-based transformation that makes your plain text unreadable to the casual observer. It's very weak in terms of encryption strength and easily broken but it does keep casual observers from simply gleaning the meaning of the cipher text via a casual glance at it.
Simple Excryption UDFs
Basic steps:
Note: the XOR operation may result in NULL bytes, and the data can no longer be handled as a string as it is. Therefore the resulting XOR'ed string information is read out of the binary buffer as a hex string.
The decryption udf just reverses the process.
#DefineFunction CRYPT(data,passphrase) len=StrLen(data) passphrase=StrFix(passphrase,passphrase,len) BBA=BinaryAlloc(len) BBB=BinaryAlloc(len) BinaryPokeStr(bba,0,data) BinaryPokeStr(bbb,0,passphrase) BinaryXor(bba,0,bbb,0,len) data2=BinaryPeekHex(bba,0,len) Return data2 #EndFunction #DefineFunction DECRYPT(code,passphrase) len=StrLen(code)/2 passphrase=StrFix(passphrase,passphrase,len) BBA=BinaryAlloc(len) BBB=BinaryAlloc(len) BinaryPokeHex(bba,0,code) BinaryPokeStr(bbb,0,passphrase) BinaryXor(bba,0,bbb,0,len) data=BinaryPeekStr(bba,0,len) Return data #EndFunction passphrase="Your large pony has brown hair." data="this might be my passoword" code=CRYPT(data,passphrase) orig=DECRYPT(code,passphrase) Message(orig,code)
Article ID: W17006
File Created: 2007:07:03:14:27:34
Last Updated: 2007:07:03:14:27:34