XOR eor offset encryption in VB
Can someone either give me an example of or point me in the direction of a good tutorial/example of using xor or offset encryption in vb?
I'm just looking for something to encode some data that is saved from my game so that people can't view them without a bit of effort. =)
Depends if the data is text/editable or binary (text you would have to scramble within a subset of each byte (using only priintable characters).
A simple method is to modify each byte of the data using some rotating XOR byte value generated by a deterministic (repeatable) function. You might be able to use a pseudo random function masked down to a byte.
setrand seed = 12345;
For i=1 to length
mask = rand() and 0x00ff
outdatabyte = indatabyte xor mask
forend
the same function can be used to decrypt what was encrypted
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement