Jump to content
  • Advertisement
Sign in to follow this  
murdock

XOR eor offset encryption in VB

This topic is 3719 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!