Sign in to follow this  

bit operators

This topic is 4862 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

I was wondering how you can use a bit operator to change data, then change it back again i want to this to work BYTE data = 'A' BYTE mask = 255 BYTE result = 0 result = data (bit operator) mask (result should hold a merged value of 'A' and 255) result = result (bit operator) mask (result should hold 'A' now) data == result Does that make any sense to anyone? If so, please tell me what bit operator would work here. Or how this is done if im just totally lost.

Share this post


Link to post
Share on other sites
if you had a text file, and wanted to send it to someone, but wanted it scrambled, you could xor every byte, then wehen they get it, xor it again to reconstruct it.

is that a good way to do it?

Share this post


Link to post
Share on other sites
It's a way to do it. If it's just for fun in that secret decoder ring kinda way, then it's good enough. Or even if you're trying to keep the data unreadable by a specific person, it's good enough.

If you're trying to keep some important data safe from any random bozo online who might sniff the data when you send it, then you'd want to look into better encryption algorithms.

-Auron

Share this post


Link to post
Share on other sites

This topic is 4862 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.

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