ångstromCTF 2022

Note : A JOURNEY TO GAIN KNOWLEDGE

Caesar and Desister

sulx{klgh_jayzl_lzwjw_ujqhlgyjshzwj_kume}

Randomly Sampled Algorithm

Vinegar Factory

Source

Overview

When connect to the server:

Analysis:

  • Easily to see that we have to bypass 50 levels of this chall to get the flag

  • The length of key is 4

  • The strange code is {start}{encrypt(fleg + 'fleg', key)}{end}

  • That means, {start} and {end} are random from noise

  • Fake flag is random from inner, now we can determind the position of char '{', '}' and '_' because they aren't encrypted

  • The most important thing is: the server has a 20 second timeout so that we have to use pwntools for scripting.

Idea:

  • Notice that encrypt(fleg + 'fleg', key) this means when plaintext's encrypted it would be like:

  • From this we can guess the last 4 characters is the cipher of 'fleg' then we can find the key easily by decrypt Vigenere, finally use the key to decrypt flag.

Solve

log log log

Source

Analysis

  • p = q * 2^1024 + 1

  • Actually, from 3 lines we know that the 880 lowest bits of e are the bits of flag

  • Now the challenge is return how to solve the discrete log problem

Idea

  • To solve this, we have to know a little bit about Legendre symbol then i got an interesting thing:

  • That mean if r is even or the least significant bit is 0 then x is a quadratic residue (legendre_symbol(a, p) == 1)

  • Otherwise, r is odd and (legendre_symbol(a, p) == 0)

Solve

Thanks for reading. Have a good day ❤️ !

Last updated