[Back] This is a Cipher CTF generator. Generate without answers [No answers] An online version is [here].

1. For the following cipher (ASCII coding), determine the decoded string: %73%63%6F%74%6C%61%6E%64

Additional information:

a (%61) b (%62) c (%63) d (%64) e (%65) f (%66) g (%67) h (%68) i (%69) j (%6A) k (%6B) l (%6C) m (%6D) n (%6E) o (%6F) p (%70) q (%71) r (%72) s (%73) t (%74) u (%75) v (%76) w (%77) x (%78) y (%79) z (%80) SPACE (%20)

Ans: scotland

2. Solve this Pigpen cipher:

Ans: igloo

3. Solve this semaphore cipher:

Ans: secret

4. Solve this Templar cipher:

Ans: sunday

5. Solve this Braille cipher:

Ans: response

6. Solve Mary's cipher:

Ans: cheese

Q. Solve the Dscript cipher:

Ans: tickle

7. Solve the Voynich cipher:

Ans: carpet

8. Solve the three-square cipher:

Ans: bone

9. Solve the gold bug cipher to recover the plaintext: 485†5-48

The Gold-Bug cipher was included in a short story by Edgar Allan Poe and which was published in 1843. It tells the tale of William Legrand and how he was bitten by a gold-colored bug. The mapping is: abcdefghijklmnopqrstuvwxyz 52-†81346,709*‡.$();?¶]¢:[ In the book he writes: Here Legrand, having re-heated the parchment, submitted it to my inspection. The following characters were rudely traced, in a red tint, between the death's-head and the goat: 53‡‡†305))6*;4826)4‡.)4‡);806*;48†8¶60))85;1‡(;:‡*8†83(88)5*†; 46(;88*96*?;8)*‡(;485);5*†2:*‡(;4956*2(5*—4)8¶8*;4069285);)6†8 )4‡‡;1(‡9;48081;8:8‡1;48†85;4)485†528806*81(‡9;48;(88;4(‡? 34;48)4‡;161;:188;‡?; This is translated as: 5 - A 3‡‡† - good 305)) - glass 6* - in ;48 - the

Ans: headache

10. Solve the ADFGVX cipher to find the plaintext of: VD VG GX AD DA XD

Ans: simple

11. What is the plain text for the following Bacon cipher: AABBA BAAAA AAAAA BAAAB BAAAB

a AAAAA g AABBA n ABBAA t BAABA b AAAAB h AABBB o ABBAB u-v BAABB c AAABA i-j ABAAA p ABBBA w BABAA d AAABB k ABAAB q ABBBB x BABAB e AABAA l ABABA r BAAAA y BABBA f AABAB m ABABB s BAAAB z BABBB

Ans: grass

12. Solve the Monk cipher:

Ans: 5703

13. What is the plain text for the following Polybius cipher: 14 43 24 32 32

Ans: drill

14. What is the plain text for the Dvorak cipher of: JGLXRAPE

Plain: abcdefghijklmnopqrstuvwxyz Cipher: axje.uidchtnmbrl'poygk,qf;

Ans: cupboard

15. What is the Atbash cipher for the word: NZIXS

Plain: abcdefghijklmnopqrstuvwxyz Cipher: ZYXWVUTSRQPONMLKJIHGFEDCBA

Ans: march

16. What is the plain text for the Rot13 cipher of: QRAZNEX

Plain: abcdefghijklmnopqrstuvwxyz Cipher: NOPQRSTUVWXYZABCDEFGHIJKLM

Ans: denmark

17. What is the plain text for the following tap cipher: .. ... . ..... . . . .... . . . ... .. ... . .....

The tap cipher uses a Polybius mapping, and where we tap (.) out the row and then tap the column count: For example: .... ..... . . .... .... .... ..... . ..... T A S T E

Q. With a Caeser cipher, if we use either a 1 letter, 2 letter or 3 letter shift (as defined below), which is the plaintext for: UQWT

For a 1 letter shift: abcdefghijklmnopqrstuvwxyz BCDEFGHIJKLMNOPQRSTUVWXYZA for two shifts: abcdefghijklmnopqrstuvwxyz CDEFGHIJKLMNOPQRSTUVWXYZAB and three shifts: abcdefghijklmnopqrstuvwxyz DEFGHIJKLMNOPQRSTUVWXYZABC

Ans: sour

18. What the plaintext for the following Baudot code: 11100001100010110000000110111100001

The coding is: 0 1 2 3 4 5 6 7 8 9 '*' 'E' '\n' 'A' ' ' 'S' 'I' 'U' '\r' 'D' 10 11 12 13 14 15 16 17 18 19 'R' 'J' 'N' 'F' 'C' 'K' 'T' 'Z' 'L' 'W' 20 21 22 23 24 25 26 27 28 29 'H' 'Y' 'P' 'Q' 'O' 'B' 'G' '' 'M' 'X', Binary Letter Figure 00000 Null Null 00001 E 3 00010 LF LF 00011 A – 00100 ' ' ' ' 00101 S Bell 00110 I 8 00111 U 7 01000 CR CR 01001 D 01010 R 4 01011 J ' 01100 N , 01101 F ! 01110 C : 01111 K ( 10000 T 5 10001 Z " 10010 L ) 10011 W 2 10100 H # 10101 Y 6 10110 P 0 10111 Q 1 11000 O 9 11001 B ? 11010 G & 11011 Shift to figures 11100 M . 11101 X / 11110 V ; 11111 Shift to letters

Ans: mistake

19. For the scrambled alphabet given below, which is the plaintext for the cipher of: MXLFZ

Plain: abcdefghijklmnopqrstuvwxyz Cipher: QHVUPIWXOJESTNLGAYMZFBRCKD

Ans: shout

20. For the following Morse code, what is the plaintext: (·— —·) (·—) (···) (···) (·— —) (— — —) (·—·) (—··)

A(·—) B(—···) C(—·—·) D(—··) E(·) F(··—·) G(— —·) G(····) I(··) J(·— — —) K(—·—) L(·—··) M(— —) N(—·) O(— — —) P(·— —·) Q(— —·—) R(·—·) S(···) T(—) U(··—) V(···—) W(·— —) X(—··—) Y(—·— —) Z(— —··)

Ans: password

21. A homomorphic cipher uses several codes for each plaintext character. For the homomorphic cipher given below, which is the plaintext for the cipher of: 18 84 80 36 77 71 93

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 07 11 17 10 25 08 44 19 02 18 41 42 40 00 16 01 15 04 06 05 13 22 45 12 55 47 31 64 33 27 26 09 83 20 03 81 52 43 30 62 24 34 23 14 46 93 50 49 51 28 21 29 86 80 61 39 56 35 36 63 76 32 54 53 95 88 65 58 57 37 66 48 70 68 89 91 71 59 38 77 67 87 73 94 00 90 60 84 69 96 74 72 78 75 92 79 82 85

Ans: january

22. For the keyword cipher, for a cipher word (and key word of "ANKLE") determine the plaintext: iomlom

The following uses a keyword of Krytos, and a message of "knowledgeispower": Here, and it should give DGHVETPSTBMIHVTL. Plaintext: 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 Encrypted: K R Y P T O S A B C D E F G H I J L M N Q U V W X Z With KRYPTOS as the keyword, all As become Ks, all Bs become Rs and so on. Encrypting the message "knowledge is power" using the keyword "kryptos": Plaintext: K N O W L E D G E I S P O W E R Encoded: D G H V E T P S T B M I H V T L

Ans: london

23. For the Bifid cipher, for a cipher word of the following determine the plaintext: lpxhneq

First we start with a grid: 1 2 3 4 5 1 B G W K Z 2 Q P N D S 3 I O A X E 4 F C L U M 5 T H Y V R Next we look up the grid, and the arrange the two character values into two rows. For example is we have a plaintext of "marylan", then "m" is "4" and "5", so we place "4" in the first row, and "5" in the second row, and continue to do this for all the letters: maryland 43554322 53533334 Next we read along the rows and merge, to give: 43 55 43 22 53 53 33 34 Next we convert them back to letters from the grid: L R L P Y Y A X Let’s try the reverse, with DXETE. For we look up the grid to get: 24 34 35 51 35 We can then put then into rows to give: 2 4 3 4 3 5 5 1 3 5 This gives us 25 (s) 45 (m), 31 (i) 43 (l) 35 (e) – which is smile.

Ans: connect

24. What is gray cipher code for the value of 4?

With a Gray cipher each binary value in a sequence differs by just one bit. Take a value of i, and calculatoe i EX-OR (i >> 1), and where >> is a shift bit right. For example, if we have 4 (0100), we have: i 0100 EX-OR 0010 ---- 0110

Ans: 110

25. Bob and Alice are using a secret cipher key generated from the first row of a Sudoku puzzle. Can you find the secret cipher key from this:

1 0 0 0 8 4 0 3 0 0 0 0 5 1 0 0 0 7 0 8 9 0 0 0 0 4 0 0 0 0 0 0 0 2 0 8 0 6 0 2 0 1 0 5 0 0 0 2 0 0 0 0 0 0 0 7 0 0 0 0 5 2 0 9 0 0 0 6 5 0 0 0 0 4 0 9 7 0 0 0 0

Ans: 1 5 7 6 8 4 9 3 2

26. For the following Straddling cipher, what is the plain text: 22 0 64 0 28 4 60

0 1 2 3 4 5 6 7 8 9 E T A O N R I S 2 B C D F G H J K L M 6 P Q / U V W X Y Z .

Ans: develop

27. For the follow cipher, we use a 3-rail code (an example given below). Which is the plaintext for the following 3-rail cipher code: CEOON CINNT

'WE ARE DISCOVERED. FLEE AT ONCE', gives: W . . . E . . . C . . . R . . . L . . . T . . . E . E . R . D . S . O . E . E . F . E . A . O . C . . . A . . . I . . . V . . . D . . . E . . . N . . to give: WECRL TEERD SOEEF EAOCA IVDEN

Ans: connection

28. The Pollux cipher, we use Morse code (see below) to determine a code (see below). Which is the plaintext for the following Pollux cipher: 81560549083806817676

To determine a code, and then map a dot, dash or seperator with the following: Dot - 0, 7 or Dash - 1, 8 or 5 Seperator - 2, 9, 6 or 3 If we take a code of "784067897459184640779", we can determine the following: 784067897459184640779 .-.. .- ..- --. .... L A U G H For example "GE" becomes "— — ·" and "·", so we can then encode to 180 2 7 9 to give 180279. Morse code: 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(— —··)

Ans: orange

29. The following Fractional cipher (see below), determine the plaintext: JGQDWQI

"Hello World" is Morse Code is: .... . .-.. .-.. --- / .-- --- .-. .-.. -.. H E L L O SPACE W O R L D We can then make this into a string with an 'x' between characters: Plain text: H e l l o w o r l d Morse string: ....x.x.-..x.-..x---xx.--x---x.-.x.-..x-.. We can now use three-character mappings to convert them back to text: ['...', '..-', '..x', '.-.', '.--', '.-x', '.x.', '.x-', '.xx', '-..', '-.-', '-.x', '--.', '---', '--x', '-x.', '-x-','-xx', 'x..', 'x.-', 'x.x', 'x-.', 'x--', 'x-x', 'xx.', 'xx-'] This mapping is: 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 . . . . . . . . . - - - - - - - - - x x x x x x x x . . . - - - x x x . . . - - - x x x . . . - - - x x . - x . - x . - x . - x . - x . - x . - x . - x . - which will map to "ABCDEF...Z". Next we can convert them back with: AGTCDHOTQODTCJ For "Peter piper picked " we get: .--.x.x-x.x.-.xx.--.x..x.--.x.x.-.xx.--.x..x-.-.x-.-x.x-..xx P e t e r ' ' p i p e r' ' p i c k e d ' ' Standard Morse code E . S ... H .... B -... 1 .---- period .-.-.- T - U ..- V ...- X-..- 2 ..--- comma --..-- I .. R .-. F ..-. C-.-. 3 ...-- query .-.-.- A .- W .-- L .-.. Y --.- 4 ....- colon ---... N -. D -.. P .--. Z --.. 5 ..... s/colon -.-.-. M -- K -.- J .--- Q --.- 6 -.... dash -....- G --. 7 --... slash -..-. O --- 8 ---.. equals -...- 9 ----. 0 -----

Ans: bacon

30. With the column cipher we lay our plain text in columns, and then use a column key, and reconstruct the columns: Using key of 01423, what is the plaintext for "ctnpaoglrga oap rree "

With the column cipher we lay our plain text in columns, and then use a column key, and recontruct the colums. If we use an order of column 3, 1, 4, 2 and 0, with a message of "whichwristwatchesareswisswristwatches", we get: 31420 ----- which wrist watch esare swiss wrist watch es We now rearrange the columns back in order: 0 1 2 3 4 ['h', 'h', 'c', 'w', 'i'] ['t', 'r', 's', 'w', 'i'] ['h', 'a', 'c', 'w', 't'] ['e', 's', 'r', 'e', 'a'] ['s', 'w', 's', 's', 'i'] ['t', 'r', 's', 'w', 'i'] ['h', 'a', 'c', 'w', 't'] [' ', 's', ' ', 'e', ' '] The result is then: Cipher: hthesth hraswrascscrssc wwweswweiitaiit

Ans: carrotorgangeapple

31. Find 10 cipher related words in this grid:

s c i o u i z a r w d m v y g a p b p m c b m m p c r e z e f o m e c t n o c r n u b s m q a m w q w l d y v t y a f b r o f d e e s p k e k r u a d r i e h d c t i m w d u e g y n c q i r o d p y d x n o q t o d z i g v l d t h c l w e d r o p r n a o a w o d r g e q l t a p r o g e d b t e y x d p p u n y m b e u i r f g j e h h c j r b p g u n b f f o y t j i s l u b i n a r y v b o l

Ans: encode,goldbug,templar,dscript,caesar,decode,cryptography,integer,memory,binary

32. Find 15 cipher related words in this grid:

l a a q z o h h n w o o k y g t j y k g s h x h v l a m i c e d a x e h z i c p c e d o c e d w g h c k z y b v i o r f f g a v m v x t k w b z s c i w y y p n d l r n o b e c e z n o i t p y r c n e a k a w h n o b d j k d t n n h p l s n a i o o i q e m g u o e f q j e e h t i q n i r l n x d g p z z f q a l t u t n l w b u u y r g t h h m c p y e r g x o m d w f a i f r e o y n g p q i q r a y z m p p r l j r f e z l a h n r r m r e h s l e c t r m n v d s i g c d s m y i p e h q t n t r g s j h s z s o a x d q m p r h j v t f w p r h v r q u w e c r i h p i t m r q l t b y k m j w l w q c b f x d c v q a j m g u t h o i k w i s l w o c

Ans: alanturing,braille,bits,decryption,memory,hexadecimal,decode,integer,cryptography,encryption,ascii,caesar,cipher,scrambled,pigpen

33. What is the Four Square cipher for the plaintext of: scotland

It uses four 5x5 matrices arranged in a square. Each matrices contains 25 letters. The upper-left and lower-right matrices are the "plaintext squares" and each contain a standard alphabet. The upper-right and lower-left squares are the "ciphertext squares" and have a mixture of characters. First we break the message into bigrams, such as ATTACK AT DAWN gives: AT TA CK AT DA WN We now uses the four 'squares' and locate the bigram to encrypt in the plain alphabet squares. With 'AT', we take the first letter from the top left square, the the second letter from the bottom right square: a b c d e Z G P T F f g h i k O I H M U l m n o p W D R C N q r s t u Y K E Q A v w x y z X V S B L M F N B D a b c d e C R H S A f g h i k X Y O G V l m n o p I T U E W q r s t u L Q Z K P v w x y z Now, like Playfair, determine the the characters in the ciphertext around the corners of the rectangle for 'AT' and this makes: a b c d e Z G P T F f g h i k O I H M U l m n o p W D R C N q r s t u Y K E Q A v w x y z X V S B L M F N B D a b c d e C R H S A f g h i k X Y O G V l m n o p I T U E W q r s t u L Q Z K P v w x y z And so we pick off 'TI' The result becomes: ATTACKATDAWN TIYBFHTIZBSY

Ans: ENCEWMCN

34. The exponential cipher uses the form of Cipher=M^e mod N. Calulate the cipher values for the following: Message=7716 N=5381 e=7

If we have a message of 1234, and an e value of 7 with an N value of 33, we get: Cipher=12347 mod 33 Cipher=7; The mod operator is the remainder after an integer division. Let’s select: G =4 N=7 Bob and Alice generate random numbers (x and y): X = 3 Y = 4 Bob calculates A: A=G^x mod N=4^3 mod 7=64 mod 7= 1 Alice calculates B: B=G^y mod N= 4^4 mod 7= 256 mod 7=4 They swap values and they generate the key: KeyBob=B^x mod N=4^3 mod 7=256 mod 7=1 KeyAlice=A^y mod N=1^4 mod7=1 mod7=1 This is their shared key: "1"

Ans: 2964

35. The Diffie Hellman method allows Bob and Alice to exchange values and end up with the same result. Calculate the shared value for: G=157, N=451, x=3, y=12

In Diffie-Hellman, Bob and Alice agree on G (a generator) and N (a prime number), and then Bob picks a random value of x, and Alice picks a random value of y: Bob (x) Alice (y) b=G^x mod N a=G^y mod N Bob sends Alice the value of b Alice sends Bob the value of a Key=a^x mod N Key=b^y modN

Ans: 25

36. Create the cipher for a multiplication cipher with a plaintext of: array (with multiplier of 3)

This cipher uses multiplication cipher theory. In this case we take each letter (P) and multiply it by a value (a). For example "c" becomes 2, and multiplied by 2 gives 4, which gives "e".As the value may be greater than 25, we take a modulo 26 operation to make sure we end up with a letter, such as: C=(a x P) mod 26 Where P is the character in the plain text, and a is the multiplier. The mod operator is the remainder from an integer divide (for example 11 mod 4 gives 3). In order to create unique cipher characters, we must use a multiplier which is co-prime (the values do not share any factors when dividing) in relation to the size of the alphabet (26), so you should use either 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23 or 25. In the following plain text values, find the ciphers.

Ans: azzau

37. The LZ coding scheme is especially suited to data which has a high degree of repetition, and makes back references to these repeated parts. Typically a flag is normally used to identify coded and unencoded parts, where the flag creates back references to the repeated sequence. With the LZ table given below, solve the following: 'P', 'i', 'c', 'k', 'y', ' ', 'p', 'e', 'o', 'p', 'l', 'e', 261, 257, 'k', ' ', 'P', 'e', 't', 'e', 'r', 271, 'a', 'n', 271, 'e', 278, 'u', 't', '-', 'B', 283, 274, 'r', ',', ' ', 't', 'i', 's', 291, 'h', 267, 262, 282, 284, 'b', 287, 275, 294, 'p', 269, 260, 262, 264, 266, 268, 258 (use Table 2 below)

The following is the LZ Coding Table 1: [256] Co [257] ow [258] ws [259] s [260] g [261] gr [262] ra [263] az [264] ze [265] e [266] i [267] in [268] n [269] gr [270] ro [271] ov [272] ve [273] es [274] s o [275] on [276] n g [277] gra [278] as [279] ss [280] s w [281] wh [282] hi [283] ic [284] ch [285] h [286] gro [287] ows [288] s i [289] in [290] groo [291] ove [292] es [293] a [294] an [295] n gr [296] rov [297] ves The following is LZ Coding Table 2: [256] Pi [257] ic [258] ck [259] ky [260] y [261] p [262] pe [263] eo [264] op [265] pl [266] le [267] e [268] pi [269] ick [270] k [271] P [272] Pe [273] et [274] te [275] er [276] r [277] Pa [278] an [279] n [280] Pe [281] ea [282] anu [283] ut [284] t- [285] -B [286] Bu [287] utt [288] ter [289] r, [290] , [291] t [292] ti [293] is [294] s [295] th [296] he [297] e p [298] pea [299] anut [300] t-b [301] bu [302] utte [303] ers [304] s p [305] pi [306] icky [307] y p [308] peo [309] opl [310] le [311] pic Example In he example above, we have: Input: Cows graze in groves on grass which grows in grooves in groves Compressed: ['C', 'o', 'w', 's', ' ', 'g', 'r', 'a', 'z', 'e', ' ', 'i', 'n', 260, 'r', 'o', 'v', 'e', 259, 'o', 268, 261, 'a', 's', 259, 'w', 'h', 'i', 'c', 'h', 269, 257, 259, 267, 286, 271, 273, 266, 276, 270, 272, 's'] Deompressed: Cows graze in groves on grass which grows in grooves in groves The first entry in the dictionary add position 256 will be 'Co', next it will be 'ow'. We can see that the following index values have been defined: The code ' g' has been defined with an index of 260. The code 's ' has been defined with an index of 259. 268, 261 represents 'n ' and 'gr', representively. The resulting dictionary entries that are added: Adding: [256] Co Adding: [257] ow Adding: [258] ws Adding: [259] s Adding: [260] g Adding: [261] gr Adding: [262] ra Adding: [263] az Adding: [264] ze Adding: [265] e Adding: [266] i Adding: [267] in Adding: [268] n Adding: [269] gr Adding: [270] ro Adding: [271] ov Adding: [272] ve Adding: [273] es Adding: [274] s o Adding: [275] on Adding: [276] n g Adding: [277] gra Adding: [278] as Adding: [279] ss Adding: [280] s w Adding: [281] wh Adding: [282] hi Adding: [283] ic Adding: [284] ch Adding: [285] h Adding: [286] gro Adding: [287] ows Adding: [288] s i Adding: [289] in Adding: [290] groo Adding: [291] ove Adding: [292] es Adding: [293] in Adding: [294] n gr Adding: [295] rov Adding: [296] ves

Ans: Picky people pick Peter Pan Peanut-Butter, tis the peanut-butters picky people pick

38. Decode the following Huffman cipher for the plaintext: 0101101011011001110111110111011

Symbol Weight Huffman Code 287 111 e 167 000 a 95 0101 i 110 1010 n 90 0100 o 106 0111 s 107 1001 t 116 1011 c 43 00101 d 50 01101 h 44 00110 l 70 11010 m 56 10001 p 44 00111 r 84 11011 u 47 01100 b 20 001000 f 23 001001 g 28 110000 y 26 100001 , 18 1100110 . 15 1100010 k 17 1100101 v 15 1100011 w 18 1100111 0 8 11001000 1 6 10000001 ' 5 110010011 - 3 100000001 3 3 100000100 ? 3 100000101 x 4 110010010 2 2 1000001101 5 2 1000001111 9 1 1000000000 j 1 1000000001 ( 1 10000011000 ) 1 10000011001 4 1 10000011100 6 1 10000011101 For example "hello" will be coded as: 00110 000 11010 11010 0111 and as a bit stream: 0011000011010110100111

Ans: airport

39. With this OTP we EX-OR the message with a one-time key (see below). Calculate the hex values for the following cipher: Word: mistake Key: simulator

If we take a message of "hello" and a key of "goodbye", we get: hello 01101000 01100101 01101100 01101100 01101111 goodbye 01100111 01101111 01101111 01100100 01100010 01111001 01100101 Now if we EX-OR them we get: 01101000 01100101 01101100 01101100 01101111 01100111 01101111 01101111 01100100 01100010 -------------------------------------------- 00001111 00001010 00000011 00001000 00001101 0 f 0 a 0 3 0 8 0 d So the result is 0f0a03080d Binary values To help you, here are a list of binary values: a chr(97) 01100001 b chr(98) 01100010 c chr(99) 01100011 d chr(100) 01100100 e chr(101) 01100101 f chr(102) 01100110 g chr(103) 01100111 h chr(104) 01101000 i chr(105) 01101001 j chr(106) 01101010 k chr(107) 01101011 l chr(108) 01101100 m chr(109) 01101101 n chr(110) 01101110 o chr(111) 01101111 p chr(112) 01110000 q chr(113) 01110001 r chr(114) 01110010 s chr(115) 01110011 t chr(116) 01110100 u chr(117) 01110101 v chr(118) 01110110 w chr(119) 01110111 x chr(120) 01111000 y chr(121) 01111001 z chr(122) 01111010 With hex values, we take four bits at a time and convert the values: 0000 0 0001 1 0010 2 0011 3 0100 4 0101 5 0110 6 0111 7 1000 8 1001 9 1010 A 1011 B 1100 C 1101 D 1110 E 1111 F

Ans: 1e001e010d0a11

Q. For the following jump cipher with jump of 4 (see below), what is the plaintext: prossecor (Jump: 8)

If we have a skip of 3, then: The social network said its members had expressed concerns that they were missing 'important updates' from the people they cared about. becomes: T cleo ii mrh psdoesh eweii mrnuasfmhpp eceauT cleo ii mrh psdoesh eweii mrnuasfmhpp eceauT cleo ii mrh psdoesh eweii mrnuasfmhpp eceau For example if we have plain text of "01234567", with a jump of 3 we get: 03614725 Now we take "epnlhtea", and match: 03614725 epnlhtea Let's take the first three charactersof 0, 1 and 2, which are e, l and e: eleXXXX Next 3, 4 and 5, which are p, h and a: elephaXX Finally for 6 and 6, which are n and t elephant

Ans: processor

40. What is the Affine cipher for the word: cisco [a=3, b=5]

The Affine cipher uses a mathematical formula to encrypt, such as for a linear equation of E(x)=(ax+b). If we use a 26 letter alphabet the operation becomes E(x)=(ax+b) mod 26, where x is the character to encrypt, and a and b are constants that are kept secret. 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 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 34 25 Example We can use any value of b (apart from 1), but a should not share a factor with 26 (this is defined as being co-prime). Thus a can be 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23 or 25. The following is taken from Wikipedia: plaintext A F F I N E C I P H E R x 0 5 5 8 13 4 2 8 15 7 4 17 Now, take each value of x, and solve the first part of the equation, (5x + 8). After finding the value of (5x + 8) for each character, take the remainder when dividing the result of (5x + 8) by 26. The following table shows the first four steps of the encrypting process. plaintext A F F I N E C I P H E R x 0 5 5 8 13 4 2 8 15 7 4 17 (5x + 8) 8 33 33 48 73 28 18 48 83 43 28 93 (5x + 8) mod 26 8 7 7 22 21 2 18 22 5 17 2 15 The final step in encrypting the message is to look up each numeric value in the table for the corresponding letters. In this example, the encrypted text would be IHHWVCSWFRCP. The table below shows the completed table for encrypting a message in the Affine cipher. plaintext A F F I N E C I P H E R x 0 5 5 8 13 4 2 8 15 7 4 17 (5x + 8) 8 33 33 48 73 28 18 48 83 43 28 93 (5x + 8) mod 26 8 7 7 22 21 2 18 22 5 17 2 15 ciphertext I H H W V C S W F R C P The cipher is generally weak as it is a monoalphabet and doesn't use a key. Overall there are 12 possible values of a (1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, and 25), and 26 possible shifts (b). Thus there are 286 possible mappings (12×26).

Ans: ldhlv

41. Find the next value: 4, 6, 10, 16, 26, 42 ...

Ans: 68

42. Find the next value: 11, 23, 47, 95, 191, 383, ...

Ans: 767

43. Find the next value: e, g, i, k, m, o, ...

Ans: q

44. What is next value in sequence of 35, 77, 143, 221, 323, ...

Hint: think of prime numbers

Ans: 437

45. What is next value in sequence of 05, 0B, 11, 17, 1D, ...

Hint: think of hex numbers Int Hex 0 00 1 01 2 02 3 03 4 04 5 05 6 06 7 07 8 08 9 09 10 0A 11 0B 12 0C 13 0D 14 0E 15 0F

Ans: 23

46. What is next value in sequence of 2, 10, 16, 24, 32, ...

Hint: think of octal numbers Int Oct 0 00 1 01 2 02 3 03 4 04 5 05 6 06 7 07 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17

Ans: 40

47. Find the next value. Enter this as the equivalent Greek alphabet character (eg 'alpha' for 'α'): β, η, μ, ρ, χ, γ, ...

alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu nu xi οmicron pi rho sigma tau upsilon phi chi psi omega α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ σ τ υ φ χ ψ ω

Ans: theta

48. What is plaintext for SYLLABARY cipher of: [31] [57] [30] [88] [71]

With the Syllabary cipher, we generate the row/column coordinates (CT) from:

Ans: faint

49. Bob has hidden secret values for x in the equation x²-11x+24=0. Can you find the secret values?

Ans: 8,3

50. For a g value of 3 and a prime number of 43, what is next value in sequence of 3, 9, 27, 38, 28, 41, ...

For a ring in encryption, we create a g value and have a prime number of N. For values of x, we get g^x (mod N). For example if we use g=2 and N=42: x 2^x (mod 59) 1 2 2 4 3 8 4 16 5 32 6 5 7 10 8 20

Ans: 37

51. For prime numbers of 19 and 71 and a seed of x0=3, what is next value in sequence of 9, 81, 1165, 131, ...

The Blum Blum Shub (BBS) method is as pseudorandom number generator and was created by Lenore Blum, Manuel Blum and Michael Shub in 1968. It uses the form of: x[n+1]=x[n]^2 (mod M) and where x0 is a random seed. The value of M is equal to pq, and where p and q are prime numbers. Let's try a simple example in Python: >>> p=7 >>> q=11 >>> M=p*q >>> x0=5 >>> x1=(x0**2)%M >>> x2=(x1**2)%M >>> x3=(x2**2)%M >>> x4=(x3**2)%M >>> print (x1,x2,x3,x4) 25 9 4 16

Ans: 973

52. With a key of 'CRYPTOGRAM' and a starting shift of 10, what is Condi cipher of: laugh

First we start with the keyword ('CRYPTOGRAM') and layout the rest of the alphabet: 1 2 3 4 5 6 7 8 9 10 11 12 13 C R Y P T O G A M B D E F 14 15 16 17 18 19 20 21 22 23 24 25 26 H I J K L N Q S U V W X Z For a message of 'On the first day I got lost.', we select an initial shift of 10. We start with 'O' and then move 10 places to 'J'. Next we have an 'n', so that we move next the first letter ('O') by 19 places. This gives 'X'. The result is: plaintext: On the first day I got lost. ciphertext: JX WNZ XRKVZ JND L UFD VWCZ.

Ans: rzpys

53. With a key of 'CRYPTOGRAM' and a starting shift of 10, what is plaintext for Condi cipher of: kxht

Ans: glum

54. With a key of '54213', what is AMSCO cipher of: curiositykilledthecat

For the AMSCO cipher, we take alternative two letter and one letter occurances, and then fit to a grid with a sequence key. For example, if we have a key of '41325', and we have: 'apessemisticpestexists', then we can layout as: 4 1 3 2 5 ap e ss e mi s ti c pe s te x is t s And thus is becomes 'e ti x e pe t ss c is a ps t em i s s' , and so the cipher is 'etixepetsscisapstemiss'

Ans: sletiolcaitdrkiecuyth

55. With a key of '14235', what is AMSCO plaintext for the ciphertext version of: peedaperiicppckkertrppepipeed

For the AMSCO cipher, we take alternative two letter and one letter occurances, and then fit to a grid with a sequence key. With a key of '32415', what is the AMSCO plaintext for the ciphertext version of: 'nwrertht bapng kiereguo'? In this we have 21 characters so it will be laid out as: X X X X X 2 1 2 1 2 1 2 1 2 1 2 1 2 1 First we lay out the key, and then populate the first column: 3 2 4 1 5 n wr e And now the next column: 3 2 4 1 5 r n th wr t e And next: 3 2 4 1 5 ba r n p th wr ng t e And next: 3 2 4 1 5 ba r ki n p th e wr ng t re e And finally: 3 2 4 1 5 ba r ki n gu p th e wr o ng t re e And the result is "barkingupthewrongtree"

Ans: peterpiperpickedapickedpepper

56. For a NULL cipher of 'bowel prior sonet adder bayes', which is the plain text?

In the NULL cipher we use the middle letter in each word. For example with the word 'radio', we can create a cipher of 'horrors bat adder prior pools'

Ans: windy

57. What is the Vigenère cipher (see below) using a key of "KING" for the word: shout

The great advantage of this type of code is that the same plaintext character will be encrypted with different values, depending on the position of the keyword. For example, if the keyword is GREEN, ‘e’ can be encrypted as ‘K’ (for G), ‘V’ (for R), ‘I’ (for E) and ‘R’ (for N). To improve the security, the greater the size of the code word, the more the rows that can be included in the encryption process. Also, it is not possible to decipher the code by a frequency analysis, as letters will change their coding depending on the current position of the keyword. It is also safe from analysis of common two- and three-letter occurrences, if the keysize is relatively long. For example ‘ee’ could be encrypted with ‘KV’ (for GR), ‘VI’ (for RE), ‘II’ (for EE), ‘IR’ (for EN) and ‘RK’ (for NG). Plain 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 1 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 a 2 c d e f g h i j k l m n o p q r s t u v w x y z a b 3 d e f g h i j k l m n o p q r s t u v w x y z a b c 4 e f g h i j k l m n o p q r s t u v w x y z a b c d 5 f g h i j k l m n o p q r s t u v w x y z a b c d e 6 g h i j k l m n o p q r s t u v w x y z a b c d e f 7 h i j k l m n o p q r s t u v w x y z a b c d e f g 8 i j k l m n o p q r s t u v w x y z a b c d e f g h 9 j k l m n o p q r s t u v w x y z a b c d e f g h i 10 k l m n o p q r s t u v w x y z a b c d e f g h i j 11 l m n o p q r s t u v w x y z a b c d e f g h i j k 12 m n o p q r s t u v w x y z a b c d e f g h i j k l 13 n o p q r s t u v w x y z a b c d e f g h i j k l m 14 o p q r s t u v w x y z a b c d e f g h i j k l m n 15 p q r s t u v w x y z a b c d e f g h i j k l m n o 16 q r s t u v w x y z a b c d e f g h i j k l m n o p 17 r s t u v w x y z a b c d e f g h i j k l m n o p q 18 s t u v w x y z a b c d e f g h i j k l m n o p q r 19 t u v w x y z a b c d e f g h i j k l m n o p q r s 20 u v w x y z a b c d e f g h i j k l m n o p q r s t 21 v w x y z a b c d e f g h i j k l m n o p q r s t u 22 w x y z a b c d e f g h i j k l m n o p q r s t u v 23 x y z a b c d e f g h i j k l m n o p q r s t u v w 24 y z a b c d e f g h i j k l m n o p q r s t u v w x 25 z 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

Ans: cpbad

58. What is the Porta cipher for the following plaintext: ASDLMBLK

We take two characters at a time and use the following mapping: Keys| 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 --------------------------------------------------------- A,B | n o p q r s t u v w x y z a b c d e f g h i j k l m C,D | o p q r s t u v w x y z n m a b c d e f g h i j k l E,F | p q r s t u v w x y z n o l m a b c d e f g h i j k G,H | q r s t u v w x y z n o p k l m a b c d e f g h i j I,J | r s t u v w x y z n o p q j k l m a b c d e f g h i K,L | s t u v w x y z n o p q r i j k l m a b c d e f g h M,N | t u v w x y z n o p q r s h i j k l m a b c d e f g O,P | u v w x y z n o p q r s t g h i j k l m a b c d e f Q,R | v w x y z n o p q r s t u f g h i j k l m a b c d e S,T | w x y z n o p q r s t u v e f g h i j k l m a b c d U,V | x y z n o p q r s t u v w d e f g h i j k l m a b c W,X | y z n o p q r s t u v w x c d e f g h i j k l m a b Y,Z | z n o p q r s t u v w x y b c d e f g h i j k l m a For example with a key of FORTIFICATION and a phase of "DEFENDTHEEASTWALLOFTHECASTLE", we get: Plain text: DEFENDTHEEASTWALLOFTHECASTLE Cipher text: SYNNJSCVRNRLAHUTUKUCVRYRLANY Plain text: DEFENDTHEEASTWALLOFTHECASTLE

Ans: passport

59. A columnar transposition does a row-column transpose (see below). Calculate the ciphertext value for the following: Word: betweenarockandahardplace, Key:GERMAN

The following is taken from http://practicalcryptography.com/ciphers/columnar-transposition-cipher/. First we use a key, such as "GERMAN", and where the number of columns will be equal to the key length (in this case we have six columns). Let's start with a message of: defend the east wall of the castle We then write the message with the key word in the first row: G E R M A N d e f e n d t h e e a s t w a l l o f t h e c a s t l e and then arrange alphabetically for the key word: A E G M N R n e d e d f a h t e s e l w t l o a c t f e a h t s e l and then read the cipher from the columns down: NALCEHWTTDTTFSEELEEDSOAFEAHL

Ans: ECHAEANDBNAREWOALEKACTRDP

60. What is the Beaufot cipher for the word: password [Key: apple]

We use a Vigenère method for the key, but change the method of resolving the ciphertext. For this we look along the top row for the plaintext letter, and then go down until we find the key, and then look along the row to the first column: Plain 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 1 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 a 2 c d e f g h i j k l m n o p q r s t u v w x y z a b 3 d e f g h i j k l m n o p q r s t u v w x y z a b c 4 e f g h i j k l m n o p q r s t u v w x y z a b c d 5 f g h i j k l m n o p q r s t u v w x y z a b c d e 6 g h i j k l m n o p q r s t u v w x y z a b c d e f 7 h i j k l m n o p q r s t u v w x y z a b c d e f g 8 i j k l m n o p q r s t u v w x y z a b c d e f g h 9 j k l m n o p q r s t u v w x y z a b c d e f g h i 10 k l m n o p q r s t u v w x y z a b c d e f g h i j 11 l m n o p q r s t u v w x y z a b c d e f g h i j k 12 m n o p q r s t u v w x y z a b c d e f g h i j k l 13 n o p q r s t u v w x y z a b c d e f g h i j k l m 14 o p q r s t u v w x y z a b c d e f g h i j k l m n 15 p q r s t u v w x y z a b c d e f g h i j k l m n o 16 q r s t u v w x y z a b c d e f g h i j k l m n o p 17 r s t u v w x y z a b c d e f g h i j k l m n o p q 18 s t u v w x y z a b c d e f g h i j k l m n o p q r 19 t u v w x y z a b c d e f g h i j k l m n o p q r s 20 u v w x y z a b c d e f g h i j k l m n o p q r s t 21 v w x y z a b c d e f g h i j k l m n o p q r s t u 22 w x y z a b c d e f g h i j k l m n o p q r s t u v 23 x y z a b c d e f g h i j k l m n o p q r s t u v w 24 y z a b c d e f g h i j k l m n o p q r s t u v w x 25 z 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 For example if we have a message of 'hello" and a key of 'bike', we first take h and 'b': Start with char (h)-↓ Plain a b c d e f g h 1 - - - - - - - i 2 - - - - - - - j 3 - - - - - - - k 4 - - - - - - - l 5 - - - - - - - m 6 - - - - - - - n 7 - - - - - - - o 8 - - - - - - - p 9 - - - - - - - q 10 - - - - - - - r 11 - - - - - - - s 12 - - - - - - - t 13 - - - - - - - u 14 - - - - - - - v 15 - - - - - - - w 16 - - - - - - - x 17 - - - - - - - y 18 - - - - - - - z 19 - - - - - - - a 20 u←------------b ← Go down to key character (b) Next we take 'e' and a key of 'i': Char (e)------↓ Plain a b c d e 1 - - - - f 2 - - - - g 3 - - - - h 4 e←------i ← Go down to key character (i) So that text of 'he' and a key of 'bi' will translate to a cipher text of 'ue'.

Ans: lpxtimym

61. What is the XOR cipher for the cipher bitstream of (with a repeated key of 'a' - 0x61 or 0110 0001b): 00000101 00000100 00001101 00010101 00000000

The bitwise operation we use is Z=A XOR B: A B Z ----- 0 0 0 0 1 1 1 0 1 1 1 0 If we use an 'a' (0110 0001) and plain text of "shape" we get: 's' 'h' 'a' 'p' 'e' Input: 01110011 01101000 01100001 01110000 01100101 Key: 01100001 01100001 01100001 01100001 01100001 --------------------------------------------------- Cipher 00010010 00001001 00000000 00010001 00000100 If we use an 'a' (0110 0001) again we get: Input: 00010010 00001001 00000000 00010001 00000100 Key: 01100001 01100001 01100001 01100001 01100001 --------------------------------------------------- Decoded 01110011 01101000 01100001 01110000 01100101 's' 'h' 'a' 'p' 'e'

Ans: delta

62. With many block ciphers we use an S-box mapping, where we take a value, and map it to another unique value. The S-box used in AES is given below. Use this to map the following data input value: 43D166A3

The following is the S-box mapping used in AES encryption: So: 230F27CC becomes: 2676cc4b

Ans: 1a3e330a

63. An encode cipher table is given below. Determine the code for the following:: \u0064\u0065\143\157\144\145

This is typically done for hex coding (\xZZ), 16-bit unicoding (\uZZZZ) and octal coding (\ZZZ).

Ans: decode

64. The Beale Cipher is a modified Book Cipher, where we replace each letter in the message with a number. The book is given below: 54 23 55 105 38

The book is here (we have arranged in 10 lines each): Still there are times I am bewildered by each mile I have traveled, each meal I have eaten, each person I have known, each room in which I have slept. As ordinary as it all appears, there are times when it is beyond my imagination. He stepped down, trying not to look long at her, as if she were the sun, yet he saw her, like the sun, even without looking. It was times like these when I thought my father, who hated guns and had never been to any wars, was the bravest man who ever lived. There is a loneliness that can be rocked. Arms crossed, knees drawn up, holding, holding on, this motion, unlike a ships, smooths and contains the rocker. Its an inside kind wrapped tight like skin. Then there is the loneliness that roams. No rocking can hold it down. It is alive. On its own. A dry and spreading thing that makes the sound of ones own feet going seem to come from a far-off place. Jam, zebras, volts, xenon and queens We start at zero. We move to the word for the number and take the first letter. For example 7 123 34 56 86" gives :"brain" 0 1 2 3 4 5 6 7 8 9 Still there are times I am bewildered by each mile 10 11 12 13 14 15 16 17 18 19 I have traveled, each meal I have eaten, each person 20 21 22 23 24 25 26 27 28 29 I have known, each room in which I have slept. 30 31 32 33 34 As ordinary as it all appears, there are times when it is beyond my imagination. He stepped down, trying not to look long at her, as if she were the sun, yet he saw her, like the sun, even without looking. It was times like these when I thought my father, who hated guns and had never been to any wars, was the bravest man who ever lived. There is a loneliness that can be rocked. Arms crossed, knees drawn up, holding, holding on, this motion, unlike a ships, smooths and contains the rocker. Its an inside kind wrapped tight like skin. Then there is the loneliness that roams. No rocking can hold it down. It is alive. On its own. A dry and spreading thing that makes the sound of ones own feet going seem to come from a far-off place. Jam, zebras, volts, xenon and queens

Ans: heart

65. The GCD (Great Common Divisor) is used in many cryptography methods, and is determined by the latest divisor that goes into two numbers. For example, the GCD of 9 and 15 is 3. Find the GCD of the following: What is GCD of 46 and 20

The GCD of 15 and 12 is 3, as 3 is the largest divisor that can go into both of these values.

Ans: 2

66. What is the Delastelle cipher (and a key of "EPSDUCVWYM.ZLKXNBTFGORIJHAQ"): tickle

An example key is: EPSDUCVWYM.ZLKXNBTFGORIJHAQ We then make three squares from this: square 1 square 2 square 3 1 2 3 1 2 3 1 2 3 1 E P S 1 M . Z 1 F G O 2 D U C 2 L K X 2 R I J 3 V W Y 3 N B T 3 H A Q If we take a plain text message of "THIS IS A TEST", we locate the text in the squares defined above: THIS IS A TEST -------------- T - 233 H - 331 I - 322 S - 113 I - 322 S - 113 A - 332 T - 233 E - 111 S - 113 T - 233 Next we would order as: THISISATEST ----------- 23333132211 33221133322 33111113233 And we would read the code in a horizontal way to give: 233 333 321 321 311 111 331 233 232 123 123 And then substitute back the letters on the grid: 233 333 321 321 311 111 331 233 232 123 123 T Q R R F E H T B C C

Ans: .IHRLL

67. What is the Nilist cipher for the plaintext of: feature Key: address Add Key: china

This example is taken from Wikipedia. First we take our key (ZEBRAS) and create a Polybius square: 1 2 3 4 5 1 Z E B R A 2 S C D F G 3 H I K L M 4 N O P Q T 5 U V W X Y Next we take our plaintext of "DYNAMITE WINTER PALACE" (Plain Text - PT) and an additive key of "RUSSIAN". We then add the mappings from the square to give the cipher text (CT): PT: 23 55 41 15 35 32 45 12 53 32 41 45 12 14 43 15 34 15 22 12 KEY: 14 51 21 21 32 15 41 14 51 21 21 32 15 41 14 51 21 21 32 15 CT: 37 106 62 36 67 47 86 26 104 53 62 77 27 55 57 66 55 36 54 27 The cipher is then 37 106 62 36 67 47 86 26 104 53 62 77 27 55 57 66 55 36 54 27 Example With a key of "HELLO", a message of "WELCOME", with an additive key of "TEST": 1 2 3 4 5 1 H E L O A 2 B C D F G 3 I K M N P 4 Q R S T U 5 V W X Y Z First we convert the message: PT: W E L C O M E 52 12 13 22 14 33 12 And then the additive key: Add Key: T E S T 44 12 43 44 Add: PT and Key 52 12 13 22 14 33 12 44 12 43 44 44 12 43 --------------------- 96 24 56 66 58 45 55 The cipher text is 96245666584555

Ans: 45394279563539

68. The Navajo cipher table is given below. What is the plaintext for this: Ma-e Gah Dzeh Nesh-chee Moashi Lin

Alphabets (English) Code Language (English) Code Language (Navajo) A Ant Wol-la-chee B Bear Shush C Cat Moashi D Deer Be E Elk Dzeh F Fox Ma-e G Goat Klizzie H Horse Lin I Ice Tkin J Jackass Tkele-cho-gi K Kid Klizzie-yazzi L Lamb Dibeh-yazzi M Mouse Na-as-tso-si N Nut Nesh-chee O Owl Ne-ash-jsn P Pig Bi-sodih Q Quiver Ca-yeilth R Rabbit Gah S Sheep Dibeh T Turkey Than-zie U Ute No-da-ih V Victor a-keh-di-glini W Weasel Gloe-ih X Cross Al-an-as-dzoh Y Yucca Tsah-as-zih Z Zinc Besh-do-gliz

Ans: french

69. A cipher key is created by performing a binary multiplication (modulo 2). For these values, work out cipher key: 00001, 01010

GF(2) - Galois field of two elements - is used in many areas including with Checksums and Ciphers. The multiplication function involves multiplying the binary values and ignoring the remainder. They are easy to implement and fast in their operation, especially in crypto and checksum functions. It basically involves some bit shifts and an EX-OR function, which makes it fast in computing the multiplication. For example 111 x 101 gives: 111 x101 ------ 111 000 111 ----- 11011 =====

Ans: 000001010

70. A cipher key is created by performing a binary divide (modulo 2). For these values, work out cipher key: 11001, 001

GF(2) - Galois field of two elements - is used in many areas including with Checksums and Ciphers. It basically involves some bit shifts and an EX-OR function, which makes it fast in computing the multiplication. For example 10010 ÷ 11 gives: 1110 ------- 11 | 10010 11 ------ 1010 11 ----- 110 11 --- 00

Ans: 111

71. An RSA cipher is 445420321440520748149497787496104633 and N= 736215183734351013328940524795120493 . By cracking N into p and q, decrypt cipher message.

Details [here]. First factorize N into p and q (here). This will give you p and q (the two prime numbers). Next we determine PHI=(p−1)(q−1). Next we derive d (the decryption key value) from e and PHI. Then decipher with Msg=C^d (pmod N). Sample Python code: from Crypto.Util.number import * import gmpy2 import sys p=954354002755510667 q=801297755486859913 c=607778777406675887172756406181993732 #N=764721720347891218098402268606191971 n = p*q PHI=(p-1)*(q-1) e=65537 d=(gmpy2.invert(e, PHI)) res=pow(c,d, n) print "Cipher: ",c print "p: ",p print "q: ",q print "=== Calc ===" print "d=",d print "n=",n print "Decrypt: %s" % ((long_to_bytes(res)))

Ans: opal

72. Can you crack the RSA Encrypted value with the following parameters:

e: 65537

N: 1175009499456896010378665903881335613

Cipher: 1136193692392450463199423637932323053

We are using 60 bit primes

Details: [here]. Here is an example: Encryption parameters e: 65537 N: 1034776851837418228051242693253376923 Cipher: 582984697800119976959378162843817868 We are using 60 bit primes Now we have to crack N by finding the primes that make up the value. If we use this [link], we get: Factors ------- 1,034,776,851,837,418,228,051,242,693,253,376,923 = 1,086,027,579,223,696,553 x 952,809,000,096,560,291 p=1,086,027,579,223,696,553 q=952,809,000,096,560,291 Now we work out PHI, which is equal to (p−1)×(q−1): >>>p=1086027579223696553 >>>q=952809000096560291 >>> print (p-1)*(q-1) 1034776851837418226012406113933120080 Now we find e^−1 (mod PHI) (and where (d×e) (mod PHI)=1), such as using [link]: Inverse of 65537 mod 1034776851837418226012406113933120080 Result: 568411228254986589811047501435713 This is the decryption key. Finally we decrypt with Message=Cipher^d (mod N): >>> d=568411228254986589811047501435713 >>> cipher=582984697800119976959378162843817868 >>> N=1034776851837418228051242693253376923 >>> print pow(cipher,d,N) 345 The message is 345 Finally, let's check the answer. So we can recipher with the encryption key and we use Cipher=M^e (mod N): >>> m=345 >>> e=65537 >>> N=1034776851837418228051242693253376923 >>> print pow(m,e,N) 582984697800119976959378162843817868 This is the same as the cipher, so the encryption and decryption keys have worked. Thus the encryption key is [65537, 1034776851837418228051242693253376923] and the decryption key is [568411228254986589811047501435713, 1034776851837418228051242693253376923]

Ans:

358