XOR eor offset encryption in VB

Started by
1 comment, last by Spodi 15 years, 11 months ago
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. =)
Advertisement



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
--------------------------------------------[size="1"]Ratings are Opinion, not Fact
http://www.rookscape.com/vbgaming/tutAL.php
NetGore - Open source multiplayer RPG engine

This topic is closed to new replies.

Advertisement