|
|
|
|
16
|
|
16
|
|
17
|
ROT13 is 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".[2] ROT13 has inspired a variety of letter and word games on-line, and is frequently mentioned in newsgroup conversations.
|
17
|
ROT13 is 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".[2] ROT13 has inspired a variety of letter and word games on-line, and is frequently mentioned in newsgroup conversations.
|
18
|
|
18
|
|
19
|
-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.[3] A becomes N, B becomes O, and so on up to M, which becomes Z, then the sequence continues at the beginning of the alphabet: 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:[3]
|
|
|
|
|
19
|
+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.[3] A becomes N, B becomes O, and so on up to M, which becomes Z, then the sequence continues at the beginning of the alphabet: 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.
|
20
|
|
20
|
|
21
|
```Java
|
21
|
```Java
|
22
|
String s = "we hold these truths to be self evident"
|
22
|
String s = "we hold these truths to be self evident"
|
|
|
|
|
29
|
|
29
|
|
30
|
The transformation can be done using a lookup table, such as the following:
|
30
|
The transformation can be done using a lookup table, such as the following:
|
31
|
|
31
|
|
|
|
32
|
+```
|
32
|
Input ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
33
|
Input ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
33
|
Output NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm
|
34
|
Output NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm
|
|
|
35
|
+```
|
34
|
For example, in the following joke, the punchline has been obscured by ROT13:
|
36
|
For example, in the following joke, the punchline has been obscured by ROT13:
|
35
|
|
37
|
|
36
|
```
|
38
|
```
|
|
|
|
|
42
|
Jul qvq gur puvpxra pebff gur ebnq?
|
44
|
Jul qvq gur puvpxra pebff gur ebnq?
|
43
|
To get to the other side!
|
45
|
To get to the other side!
|
44
|
```
|
46
|
```
|
|
|
47
|
+
|
|
|
48
|
+### Part2
|
|
|
49
|
+
|
|
|
50
|
+Make a method that reads a textfile (sonnet18.txt), encrypts it, and writes it back out to a different file (sonnet18.enc)
|
|
|
51
|
+Prove that when you read in (sonnet18.enc), run the same crypt again, and prove that it produces the same original text.
|