Skip to content

Instantly share code, notes, and snippets.

@tjade273

tjade273/rsa.md Secret

Last active November 17, 2018 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjade273/ded27b5a0e19dc040da854fd14733519 to your computer and use it in GitHub Desktop.
Save tjade273/ded27b5a0e19dc040da854fd14733519 to your computer and use it in GitHub Desktop.
RSA part 1

RSA Challenge

The server accepts any 1024 bit RSA ciphertext, base64 encoded, and decrypts it using the private key corresponding to:

  • RSA Public Key:

    -----BEGIN PUBLIC KEY-----
    MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCvP/QCbo6bihIPrf68zjsJXZ6g
    1qVzxK9SQo94CwsY10kSjwddz2inke18YE5AYnnhqLMb8CnyuHIplpCvr6av5kdP
    Va5BtrUVzockQYovnrzASif4gccPfZYrvaiRbTwUNLyF/S0Lb2Y5vFwPPw95VaEo
    WJ3d1vNm5Fh9oShGiwIDAQAB
    -----END PUBLIC KEY-----
    
  • Encrypted Flag (base64):

    bXqnLSa8E8KbD3A/isI7++FNAFTXH6nF184TKUaQBePapvPfcnlZ782mDuMwL4E7Be57HcGBOFMIU/3ALuxq2+cUlyMK07jEU1vdJDbUgXbc3wEbJtWHbs1Y3DJb+DCi9PiDZplE2G1nAXkQQWTuv2+dCv6pUFRgWeocQty8y/s=
    

Example usage

cat  <(head -c 118 /dev/zero) <(echo -n -e "testing...") |
openssl rsautl -encrypt -raw -pubin -inkey key.pub |
openssl base64  -A | xargs echo | nc chc.cs.cornell.edu 1352

The goal is to decrypt the flag. Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment