Follow us on Twitter!
I'd prefer to die standing, than to live on my knees - Che Guevara
Wednesday, April 23, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 22
Guests Online: 17
Members Online: 5

Registered Members: 82876
Newest Member: bhl1986
Latest Articles
View Thread

HellBound Hackers | Computer General | Cryptography

Author

Beginners ROT-3 in C


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 23-04-07 10:42
Hi

I started learning C, and decided (maybe foolishly) that I would try and write a so called 'ceaser cipher' as one of my first programs. However, I got stuck when trying to assign the numbers to my alphabet. I had thought of using the unicode values but I read somewhere they arnt the same on all systems (or locales?). I dont have my original source, it did nothing more than read the characters to be encrypted anyway.

Can anyone quickly draft some pseudocode or something to explain how simple encryption ciphers work?

Thanks in advance,



Author

RE: Beginners ROT-3 in C


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 24-04-07 09:36
jjbutler88 wrote:
However, I got stuck when trying to assign the numbers to my alphabet.


I'd use the hex values of the letters (a=61 etc) as then you just read in chars and treat them as hex. You then add 13 (or whatever your encryption is) and just need to decide whether you are sticking to alphanumeric (in which case you obviously want to loop back to 61h if you exceed 5Bh).

Good luck with it.
Author

RE: Beginners ROT-3 in C


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 24-04-07 12:46
just do a foreach on the character string and have another string containing the rot13 version, which you add to depending on the value of each character. Smile


Author

RE: Beginners ROT-3 in C


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 24-04-07 13:59
Here you go http://rafb.net/p. . .4NO16.html

Have a nice day
Author

RE: Beginners ROT-3 in C


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 24-04-07 15:09
Thanks all, especially JohnDoe. I didnt expect anyone to actually code me an example! I will expand on the example to create better encryption schemes and repost them to HBH (providing the government hasnt shut us down! Sad)