Cipher Decrypt

Identify:

CyberChef

MD5 Decrypt

cat data.txt | base64 -d  ..decode

Encode-to-Copy

Encode:
cat /home/lara/.gnupg/secring.gpg | gzip | base64
H4sIAGpz0l8AAwEbBeT6lQHhBEfYL10RBACMAcvxnrh7A6s3S...

Decode:
echo 'H4sIAG...' | base64 -d | gzip -d > secring.gpg

Encrypt with OpenSSL

> openssl enc -aes256 -k MyPaxxKey -in /tmp/backup.tgz  -out /tmp/backup.tgz.enc

Decrypt OpenSSL

> openssl enc -d -aes-256-cbc -in secret.txt.enc -out -secret.txt
> openssl enc -d -aes-256-cbc -k MyPaxxKey -in /tmp/backup.tgz.enc -out /tmp/backup.gz
> gunzip /tmp/backup.gz 
> cat /tmp/backup

Substitution Cipher

You have the Encryption AND Decryption .. but need the KEY https://www.boxentriq.com/code-breaking/cryptogram Example: Brainfuck:

IB EVMJGASVCJNM, C TRKTGIGRGIAB EIJNPV IT C OPGNAZ AQ PBEVMJGIBS KM YNIEN RBIGT AQ JWCIBGPHG CVP VPJWCEPZ YIGN EIJNPVGPHG, CEEAVZIBS GA C QIHPZ TMTGPO; GNP "RBIGT" OCM KP TIBSWP WPGGPVT (GNP OATG EAOOAB), JCIVT AQ WPGGPVT, GVIJWPGT AQ WPGGPVT, OIHGRVPT AQ GNP CKAXP, CBZ TA QAVGN. GNP VPEPIXPV ZPEIJNPVT GNP GPHG KM JPVQAVOIBS GNP IBXPVTP TRKTGIGRGIAB. GNP QWCS IT CTIOJWPTRKTGIGRGIAB
in cryptography a substitution cipher is a method of encrypting by which units of plaintext are replaced with ciphertext according to a fixed system the units may be single letters the most common pairs of letters triplets of letters mixtures of the above and so forth the receiver deciphers the text by performing the inverse substitution the flag is asimplesubstitution

Key = fuckmybrain

Caesar Cipher (ROT13)

rotated 13 positions
lowercase and uppercase letters are 
> cat data.txt | tr a-zA-Z n-za-mN-ZA-M

Base64

Example: ISwwYGAKYAo%3D

Uudecode

Example: !,@``
Hint: A(&%N9"`Q/3(@=6YI;VX@86QL('-E;&5C="`Q+#(L,RTM

Hex

GPG Keys

Found:
/home/kate/.gnupg/secring.gpg

Encode-to-Copy:
> cat /home/kate/.gnupg/secring.gpg | gzip | base64
XYZ123...

Decrypt Method:
> echo 'XYZ123...' | base64 -d | gzip -d > secring.gpg

Copy into YOUR directory (win/lin), So you can decrypt

Windows:
c:\users\name\AppData\Roaming\gnupg\pubring.gpg
c:\users\name\AppData\Roaming\gnupg\secring.gpg

Linux:
/home/name/.gnupg/pubring.gpg
/home/name/.gnupg/secring.gpg

Verify keys:
gpg --list-keys
gpg --list-secret-keys

Windows:
Run gpg exe from:
c:\Program Files (x86)\GNU\GnuPG

Decrypt:
gpg -d -o outputfile encryptedfilename
gpg -d -o pii.csv pii.csv.gpg

-d decrypt
-o output filename

You need a passphrase to unlock the secret key for
user: "Kate <kate@domain.tgt>"
kate:passwurd
Decrypted!!

holiday hack 2020

unzip, bzip2, tar, xxd, xz, uncompress, cat, win !!!

cat packagev1 | base64 -d > packagev2
file packagev2  ...Zip archive data
unzip packagev2
file package.txt.Z.xz.xxd.tar.bz2  ..bzip2 compressed data,
bzip2 -d package.txt.Z.xz.xxd.tar.bz2 
file package.txt.Z.xz.xxd.tar  ..POSIX tar archive
tar -xvf package.txt.Z.xz.xxd.tar 
file package.txt.Z.xz.xxd      ..ASCII text
xxd ..is a hexdump tool
xxd -r package.txt.Z.xz.xxd > package.txt.Z.xz
file package.txt.Z.xz  ..XZ compressed data
xz --decompress package.txt.Z.xz
file package.txt.Z     ..compressd data 16 bits
uncompress package.txt.Z
cat package.txt
North Pole: The Frostiest Place on Earth
Win!!

RSA Wiener

decrypt given p, q and e
final: python
convert to hex, then ascii
> pt = 123
> str(hex(pt))
> str(hex(pt)[2:-1]).decode('hex')
flag!

bash loop base64

for i in $ seq(0 9); do echo -n '| base64-d';done
cat pwdbackup.txt | base64 -d | etc...

python loop base64

import base64
inp_string = "Vm0wd2QyUXlVWGxWV0d4WFlURndVRl="
times = 10
for i in range(times):
    inp_string = base64.b64decode(inp_string)
out_string = inp_string.decode('UTF-8')
print(out_string)

Last updated