Skip to content

abdorhl/c1ph3r

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C1ph3r - Encryption Cracker

Brute-force decrypt stuff with 9 algorithms. Good for CTF and pentesting.

What It Does

  • 9 algorithms: AES, DES, 3DES, Blowfish, ARC2, ARC4, CAST, XOR, RSA
  • 4 block modes: ECB, CBC, CFB, OFB
  • Fast: Multithreaded, tests all combinations in parallel
  • Smart detection: Identifies valid decryptions by scoring plaintext quality
  • Auto-detect mode: Don't know the algo? Let it figure it out

Install

pip install -r requirements.txt

Usage

Try one key:

python c1ph3r.py -c "base64_ciphertext" -k "password"

Try wordlist:

python c1ph3r.py -c "base64_ciphertext" -k common_keys.txt

Only specific algorithms:

python c1ph3r.py -c "data" -k keys.txt -a AES DES3

Faster (more threads):

python c1ph3r.py -c "data" -k keys.txt -t 8

Find keywords in results:

python c1ph3r.py -c "data" -k keys.txt --keywords flag ctf

Auto-Detect The Algorithm

Don't know which algorithm was used? Use the --auto flag:

python c1ph3r.py -c "ciphertext" -k keys.txt --auto

It will test all likely algorithms and show them ranked by confidence score.

Python Usage

Basic:

from c1ph3r import CrackerFactory
import base64

ciphertext = base64.b64decode("your_base64")
keys = [b"key1", b"key2"]

cracker = CrackerFactory.create_fast(threads=8)
results = cracker.crack(ciphertext, keys)

for score, plaintext, algo, mode, key in results:
    print(f"{algo}/{mode}: {plaintext}")

Auto-detect:

from c1ph3r.autodetect import C1ph3rAutodetect

detector = C1ph3rAutodetect()
detector.run(ciphertext, keys)

Test Files

Examples in tests/ folder:

  • test.txt - 7 test vectors for all algorithms
  • test-keys.txt - 7 keys that decrypt test vectors

See tests/README.md for details.

Options

-c, --ciphertext      Base64 ciphertext (required)
-k, --key             Key or wordlist file (required)

-a, --algorithms      Algorithms to try (default: all)
-m, --modes           Modes to try (default: all)
-t, --threads         Threads (default: 4)

-s, --min-score       Min score 0-1 (default: 0.5)
--keywords            Boost results with these words
-n, --top-results     Show top N results (default: 10)

--auto                Auto-detect algorithm
--show-hex            Show hex output
--show-stats          Show stats

Algorithms

Name Key Size Speed
AES 16/24/32 bytes Fast
DES 8 bytes Slow
3DES 16/24 bytes Slow
Blowfish 4-56 bytes Fast
ARC2 1-128 bytes Fast
ARC4 1-256 bytes Very Fast
CAST 5-16 bytes Fast
XOR Any Very Fast
RSA 1024+ bits Slow

License

MIT - Made by p1p4w

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages