Writeups
  • Writeups
  • CTF Writeups
    • ctfs
      • BRCTF
      • CloudSEK - BSides Cyber Security CTF 2023
      • CloudSEK - Nullcon Cyber Security CTF 2023
      • CyberHavoc CTF 2023
      • Cyber Heroines CTF
      • IWCON CTF 2023
      • SecurityBoat - October CTF 2023
      • The Hacker101 CTF
      • Wizer CTF Event 6 Hour Challenge
      • FooBar CTF 2023
      • Lag and Crash 3.0
      • NahamCon CTF 2022
        • Crash Override:
        • Exit Vim:
        • Flagcat:
        • Flaskmetal Alchemist:
        • Personnel:
        • Poller:
        • Prisoner:
        • Quirky:
        • Read The Rules:
        • Technical Support:
        • Wizard:
      • picoCTF
        • crypto
          • Easy Peasy
    • files
  • HTB
    • HTB Challenges
      • Baby Time Capsule
      • Lost Modulus
      • RLotto
      • Toxic | HTB Web Challenge
      • xorxorxor
    • HTB Machines
      • HTB Machine Precious
      • HTB Machine Stocker
  • Other Challenges
    • Academy Box - PEH Capstone TCM Security
    • Saptang Labs Hiring Challenge
Powered by GitBook
On this page

Was this helpful?

  1. HTB
  2. HTB Challenges

xorxorxor

EASY , Crypto

DESCRIPTION: Who needs AES when you have XOR?


By looking at python code for encryption we know that length of key is 4 and

flag xor key = encrypted text so, if we do xor of cipher text and first 4 character of flag that we know is "HTB{" we get the key.

(encrypted text) xor 'HTB{' = key

now we have the key to decrypt the flag:

cipher xor key = flag

python code:

from pwnlib.util.fiddling import unhex, xor
eb = bytes.fromhex('134af6e1297bc4a96f6a87fe046684e8047084ee046d84c5282dd7ef292dc9')
key = xor(eb, b'HTB{')[:4]
print(xor(eb, key).decode())

flag: HTB{rep34t3d_x0r_n0t_s0_s3cur3}

PreviousToxic | HTB Web ChallengeNextHTB Machines

Last updated 1 year ago

Was this helpful?