Sign in to follow this  
murdock

XOR eor offset encryption in VB

Recommended Posts

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. =)

Share this post


Link to post
Share on other sites



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[i] = indatabyte[i] xor mask
forend

the same function can be used to decrypt what was encrypted

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this