Friday, February 27, 2009

What Is ROT13? & ROT13 C++ Source Code

What Is ROT13?

ROT13 replaces each letter by its partner 13 characters further along the alphabet. For example, HELLO becomes URYYB (or, reversing, URYYB becomes HELLO again).

ROT13 (”rotate by 13 places”, sometimes hyphenated ROT-13) is a simple substitution cipher used in online forums as a means of hiding spoilers, punchlines, puzzle solutions, and offensive materials from the casual glance. ROT13 has been described as the “Usenet equivalent of a magazine printing the answer to a quiz upside down”.ROT13 is a variation of the Caesar cipher, developed in ancient Rome.

ROT13 is its own inverse; that is, to undo ROT13, the same algorithm is applied, so the same action can be used for encoding and decoding. The algorithm provides no real cryptographic security and should never be used for such. It is often cited as a canonical example of weak encryption. ROT13 has inspired a variety of letter and word games on-line, and is frequently mentioned in newsgroup conversations.

Applying ROT13 to a piece of text merely requires examining its alphabetic characters and replacing each one by the letter 13 places further along in the alphabet, wrapping back to the beginning if necessary.A becomes N, B becomes O, and so on up to M, which becomes Z, then the sequence reverses: N becomes A, O becomes B, and so on to Z, which becomes M. Only those letters which occur in the English alphabet are affected; numbers, symbols, whitespace, and all other characters are left unchanged. Because there are 26 letters in the English alphabet and 26 = 2 × 13, the ROT13 function is its own inverse

The transformation can be done using a lookup table, such as the following:

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz

NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm

For example, in the following joke, the punchline has been obscured by ROT13:

How can you tell an extrovert from an

introvert at NSA? Va gur ryringbef,

gur rkgebireg ybbxf ng gur BGURE thl’f fubrf.

Transforming the entire text via ROT13 form, the answer to the joke is revealed:

Ubj pna lbh gryy na rkgebireg sebz na

vagebireg ng AFN? In the elevators,

the extrovert looks at the OTHER guy’s shoes.

A second application of ROT13 would restore the original.

C++ SOURCE CODE OF ROT13 Encryption

/*ROT 13 Encryption Example By MUBASHAR ISLAM

mubashar_islam2000@yahoo.com */

#include

#include

char globel; // Globel Veriable Used To Output Encrypted Values From Function

void rot13(char); //rot13 Function Declaration

void main() // Start of Main() Function

{

char input[5000]; // Array Of 5000 Charactors For Input

char chr; // We Use This As Temp CHAR verable to Pass Chractor To Functions One By One

cout<<”Enter DATA TO Encrypt Using ROT13:”<
cin.get(input,5000); // Stores The Data In Input Verable

for(int q=0;q
{

chr = input[q]; // gets charactor from input array and stores it in chr veriable;

rot13(chr); // called the function rot13 and passed chr veraible;

cout<
globel = ‘ ‘; // reassign ‘ ‘ empty space to globel veriable;

} // loop closed

getch(); // stops output until key is pressed

}

void rot13(char c) // rot13 function defination;

{

int temp; // used to store ascii code of C passed by Function Call;

temp = c; // Assigned Ascii code of C to temp;

if(temp>=97 && temp<=122) // Checks if Charactor Is in Small Case

{

char abc[26]={’a',’b',’c',’d',’e',’f',’g',’h',’i',’j',’k',’l',’m',’n',’o',’p',’q',’r',’s’,'t’,'u’,'v’,'w’,'x’,'y’,'z’}; // array of small Aplphabets;

for(int i=0;i<26;i++) // This Loop Searches The Same CHAR in abc Array

{

if(abc[i] == c) // Matching One By One With ALL CHARS & If Matched

{

if(i>=13) // It Checks if CHAR is Greater or equals to abc[13] then ;

{

temp = abc[i-13]; // Decrease It By 13 And Assign its ASCII to temp e.g abc[13-13] = abc[0] = ‘a’;

}

else // or if it is less Then abc[13];

{

temp = abc[i+13]; // Increase It By 13 And Assign its ASCII to temp;

}

}

}

}

else // Else if Letter Is Capital

{

char abc1[26]={’A',’B',’C',’D',’E',’F',’G',’H',’I',’J',’K',’L',’M',’N',’O',’P',’Q',’R',’S',’T',’U',’V',’W',’X',’Y',’Z'};

for(int k=0;k<26;k++) // This Loop Searches The Same CHAR in abc Array

{

if(abc1[k] == c) // Matching One By One With ALL CHARS & If Matched

{

if(k>=13) // It Checks if CHAR is Greater or equals to ‘n’ e.g abc[13] = n then ;

{

temp = abc1[k-13]; // Decrease It By 13 And Assign its ASCII to temp e.g abc[13-13] = abc[0] = ‘a’;

}

else // or if it is less Then abc[13];

{

temp = abc1[k+13]; // Increase It By 13 And Assign its ASCII to temp;

}

}

}

}

globel = temp; // And After ALL Assign The ASCII of temp to globel , So globel us Char type Veriable it Converts Ascii to CHAR;

}

Drives Background Image 3.0



With the help of Drives Background Image you can easily set background image of any drives. You can also change drives icons easily.

Drives Background Image supports:

* Floppy Drives
* Hard Drives
* Usb Flash Drives
* Mass Storage Media
* Any Other Drives

Features:

* Auto detect Available Drives
* Set Background To Multiple Drives
* Remove Background From Multiple Drives
* Set Icons To Multiple Drives
* Remove Icon From Multiple Drives
* Auto Recover Default Icons
* Change Drives Text Colors
* Update Drives Text Color Without Losing Background
* Drive Preview In Real Time
* Double Click On Drive Opens Drive
* Transparent Effect
* Icon Sent To Tray So No Taskbar Space Used
* Icon Preview
* Easy Clean GUI

Download Drives Bckground Image 3.0