# Cryptography

### The Numbers \[50 pts]

> **Description**
>
> &#x20;The [numbers](https://jupiter.challenges.picoctf.org/static/f209a32253affb6f547a585649ba4fda/the_numbers.png)... what do they mean?

**Solution**

Given *16 9 3 15 3 20 6 { = picoCTF* \[given that is the format]\
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26\
&#x20;  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\
Thus *20 8 5 14 21 13 2 5 18 19 13 1 19 15 14 }  = thenumbersmason}*

**Flag: PICOCTF{THENUMBERSMASON}**

### Easy1 \[100 pts] \[Not Solved]

> **Description**
>
> &#x20;The one time pad can be cryptographically secure, but not when you know the key. Can you solve this? We've given you the encrypted flag, key, and a table to help `UFJKXQZQUNB` with the key of `SOLVECRYPTO`. Can you use this [table](https://jupiter.challenges.picoctf.org/static/1fd21547c154c678d2dab145c29f1d79/table.txt) to solve it?.

**Solution**

a

**Flag:**&#x20;

### 13 \[100 pts]

> **Description**
>
> &#x20;Cryptography can be easy, do you know what ROT13 is? `cvpbPGS{abg_gbb_onq_bs_n_ceboyrz}`

**Solution**

I could just go to an online converter, BUT I decided to write the code myself.

```
enc_message = 'cvpbPGS{abg_gbb_onq_bs_n_ceboyrz}'
message = ""
rot = 13
alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
for c in enc_message:
	try:
		index = alphabet.index(c)
		new_letter = alphabet[(index + rot )% len(alphabet)]
		if index < 26: # Fix mismatched casing
			message += new_letter.lower()
		elif index > 26:
			message += new_letter.upper()
	except: # Doesn't exist in alphabet
		message += c
		continue
print(message)
```

**Flag: picoCTF{not\_too\_bad\_of\_a\_problem}**

### caesar \[100 pts]

> **Description**
>
> &#x20;Decrypt this [message](https://jupiter.challenges.picoctf.org/static/6385b895dcb30c74dbd1f0ea271e3563/ciphertext).

**Solution**

Reusing the code from earlier with a little modification because we need to try all possibilities to get to this point I made this code

```python
enc_message = '{dspttjohuifsvcjdpoabrkttds}'
alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
for shift in range(0, 26): # Shift 1 to 25 letters (26 would be no shift)
	message = ''
	for c in enc_message:
		try:
			index = alphabet.index(c)
			new_letter = alphabet[(index + shift)% len(alphabet)]
			if index < 26: # Fix mismatched casing
				message += new_letter.lower()
			elif index > 26:
				message += new_letter.upper()
		except: # Doesn't exist in alphabet
			message += c
			continue
	print(str(shift) + " " + message)
```

**Flag: picoCTF{crossingtherubiconzaqjsscr}**

### la cifra de \[200 pts] \[Not Solved]

> **Description**
>
> &#x20;I found this cipher in an old book. Can you figure out what it says? Connect with `nc jupiter.challenges.picoctf.org 32411`.

**Solution**

When type in the command it returns

> Encrypted message: Ne iy nytkwpsznyg nth it mtsztcy vjzprj zfzjy rkhpibj nrkitt ltc tnnygy ysee itd tte cxjltk
>
> Ifrosr tnj noawde uk siyyzre, yse Bnretèwp Cousex mls hjpn xjtnbjytki xatd eisjd
>
> Iz bls lfwskqj azycihzeej yz Brftsk ip Volpnèxj ls oy hay tcimnyarqj dkxnrogpd os 1553 my Mnzvgs Mazytszf Merqlsu ny hox moup Wa inqrg ipl. Ynr. Gotgat Gltzndtg Gplrfdo
>
> Ltc tnj tmvqpmkseaznzn uk ehox nivmpr g ylbrj ts ltcmki my yqtdosr tnj wocjc hgqq ol fy oxitngwj arusahje fuw ln guaaxjytrd catizm tzxbkw zf vqlckx hizm ceyupcz yz tnj fpvjc hgqqpohzCZK{m311a50\_0x\_a1rn3x3\_h1ah3x7g996649}
>
> Ehk ktryy herq-ooizxetypd jjdcxnatoty ol f aordllvmlbkytc inahkw socjgex, bls sfoe gwzuti 1467 my Rjzn Hfetoxea Gqmexyt.
>
> Tnj Gimjyèrk Htpnjc iy ysexjqoxj dosjeisjd cgqwej yse Gqmexyt Doxn ox Fwbkwei Inahkw.
>
> Tn 1508, Ptsatsps Zwttnjxiax tnbjytki ehk xz-cgqwej ylbaql rkhea (g rltxni ol xsilypd gqahggpty) ysaz bzuri wazjc bk f nroytcgq nosuznkse ol yse Bnretèwp Cousex.
>
> Gplrfdo’y xpcuso butvlky lpvjlrki tn 1555 gx l cuseitzltoty ol yse lncsz. Yse rthex mllbjd ol yse gqahggpty fce tth snnqtki cemzwaxqj, bay ehk fwpnfmezx lnj yse osoed qptzjcs gwp mocpd hd xegsd ol f xnkrznoh vee usrgxp, wnnnh ify bk itfljcety hizm paim noxwpsvtydkse.

**Flag:**&#x20;

### Tapping \[200 pts] <a href="#tapping" id="tapping"></a>

> **Description**
>
> &#x20;Theres tapping coming in from the wires. What's it saying `nc jupiter.challenges.picoctf.org 21610`.

**Solution**

Hmmm, let me just guess Morse code maybe. Connecting it gives an easy impression with \
.--. .. -.-. --- -.-. - ..-. { -- ----- .-. ... ...-- -.-. ----- -.. ...-- .---- ... ..-. ..- -. ...-- ----. ----- ..--- ----- .---- ----. ..... .---- ----. }\
Which put into [Cyber Chef](https://gchq.github.io/CyberChef/#recipe=From_Morse_Code\('Space','Line%20feed'\)) comes out the flag. (Note to do this you have to remove the {})

**Flag: PICOCTF{M0RS3C0D31SFUN3902019519}**

### Flags \[200 pts] \[Not Solved]

> **Description**
>
> &#x20;What do the [flags](https://jupiter.challenges.picoctf.org/static/fbeb5f9040d62b18878d199cdda2d253/flag.png) mean?

**Solution**

a

**Flag:**&#x20;

### Mr-Worldwide \[200 pts] \[Not Solved]

> **Description**
>
> &#x20;A musician left us a [message](https://jupiter.challenges.picoctf.org/static/d5570d48262dbba2a31f2a940409ad9d/message.txt). What's it mean?

**Solution**

a

**Flag:**&#x20;

### rsa-pop-quiz \[200 pts] \[Not Solved]

> **Description**
>
> &#x20;Class, take your seats! It's PRIME-time for a quiz... `nc jupiter.challenges.picoctf.org 58617`

**Solution**

a

**Flag:**&#x20;

### waves over lambda \[300 pts] \[Not Solved]

> **Description**
>
> &#x20;We made a lot of substitutions to encrypt this. Can you decrypt it? Connect with `nc jupiter.challenges.picoctf.org 43522`.

**Solution**

a

**Flag:**&#x20;

### miniRSA \[300 pts] \[Not Solved]

> **Description**
>
> &#x20;Let's decrypt this: [ciphertext](https://jupiter.challenges.picoctf.org/static/d21037ad23ed84cfff20a84768a0f2b2/ciphertext)? Something seems a bit small.

**Solution**

a

**Flag:**&#x20;

### b00tl3gRSA2 \[400 pts] \[Not Solved]

> **Description**
>
> &#x20;In RSA d is a lot bigger than e, why don't we use d to encrypt instead of e? Connect with `nc jupiter.challenges.picoctf.org 19566`.

**Solution**

a

**Flag:**&#x20;

### AES-ABC \[400 pts] \[Not Solved]

> **Description**
>
> &#x20;AES-ECB is bad, so I rolled my own cipher block chaining mechanism - Addition Block Chaining! You can find the source here: [aes-abc.py](https://jupiter.challenges.picoctf.org/static/1b1beb0a49c958d0f2423800eaff58a7/aes-abc.py). The AES-ABC flag is [body.enc.ppm](https://jupiter.challenges.picoctf.org/static/1b1beb0a49c958d0f2423800eaff58a7/body.enc.ppm)

**Solution**

a

**Flag:**&#x20;

### b00tl3gRSA3 \[450 pts] \[Not Solved]

> **Description**
>
> &#x20;Why use p and q when I can use more? Connect with `nc jupiter.challenges.picoctf.org 4557`.

**Solution**

a

**Flag:**&#x20;

### john\_pollard \[500 pts] \[Not Solved]

> **Description**
>
> &#x20;Sometimes RSA [certificates](https://jupiter.challenges.picoctf.org/static/c882787a19ed5d627eea50f318d87ac5/cert) are breakable

**Solution**

a

**Flag:**&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://codingmace.gitbook.io/masterward/ctf/2019/picoctf/cryptography.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
