intro lessons 5
This commit is contained in:
parent
5a6f3e0b7e
commit
1c7b2f2e64
3 changed files with 18 additions and 8 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
from intro import int_to_ascii, hex_to_ascii, hex_to_b64, int_to_message_rsa
|
from intro import int_to_ascii, hex_to_ascii, hex_to_b64, int_to_message_rsa, xor_13
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# Intro-level challenge
|
# Intro-level challenge
|
||||||
|
|
@ -7,4 +7,5 @@ if __name__ == "__main__":
|
||||||
print(hex_to_ascii("63727970746f7b596f755f77696c6c5f62655f776f726b696e675f776974685f6865785f737472696e67735f615f6c6f747d"))
|
print(hex_to_ascii("63727970746f7b596f755f77696c6c5f62655f776f726b696e675f776974685f6865785f737472696e67735f615f6c6f747d"))
|
||||||
print(hex_to_b64("72bca9b68fc16ac7beeb8f849dca1d8a783e8acf9679bf9269f7bf"))
|
print(hex_to_b64("72bca9b68fc16ac7beeb8f849dca1d8a783e8acf9679bf9269f7bf"))
|
||||||
print(int_to_message_rsa(11515195063862318899931685488813747395775516287289682636499965282714637259206269))
|
print(int_to_message_rsa(11515195063862318899931685488813747395775516287289682636499965282714637259206269))
|
||||||
|
print("crypto{{{}}}".format(xor_13("label")))
|
||||||
# fmt: on
|
# fmt: on
|
||||||
|
|
|
||||||
9
intro.py
9
intro.py
|
|
@ -1,6 +1,6 @@
|
||||||
import base64
|
import base64
|
||||||
from Crypto.Util.number import *
|
from Crypto.Util.number import long_to_bytes
|
||||||
from pwntools import xor
|
from pwn import xor
|
||||||
|
|
||||||
|
|
||||||
# Challenge intro-1
|
# Challenge intro-1
|
||||||
|
|
@ -24,3 +24,8 @@ def hex_to_b64(input: str) -> bytes:
|
||||||
# Challenge intro-4
|
# Challenge intro-4
|
||||||
def int_to_message_rsa(input: int) -> str:
|
def int_to_message_rsa(input: int) -> str:
|
||||||
return long_to_bytes(input)
|
return long_to_bytes(input)
|
||||||
|
|
||||||
|
|
||||||
|
# Challenge intro-5
|
||||||
|
def xor_13(input: str) -> str:
|
||||||
|
return xor(input, 13).decode("utf-8")
|
||||||
|
|
|
||||||
14
shell.nix
14
shell.nix
|
|
@ -3,12 +3,16 @@ let
|
||||||
in
|
in
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
packages = [
|
packages = [
|
||||||
pkgs.python314
|
(pkgs.python314.withPackages (
|
||||||
|
python-pkgs: with python-pkgs; [
|
||||||
|
python-lsp-server
|
||||||
|
sympy
|
||||||
|
pycryptodome
|
||||||
|
pwntools
|
||||||
|
|
||||||
|
]
|
||||||
|
))
|
||||||
pkgs.openssl
|
pkgs.openssl
|
||||||
pkgs.ruff
|
pkgs.ruff
|
||||||
pkgs.python314Packages.python-lsp-server
|
|
||||||
pkgs.python314Packages.pwntools
|
|
||||||
pkgs.python314Packages.pycryptodome
|
|
||||||
pkgs.python314Packages.sympy
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue