Skip to content

Latest commit

 

History

History
165 lines (139 loc) · 8.5 KB

README.md

File metadata and controls

165 lines (139 loc) · 8.5 KB

cryptoguess

😄 cryptoguess automatically detects and parses cryptography keys from files

CircleCI GoDoc License GitHub release Go Report Card CodeFactor codecov Docker Metrics Made by Manfred Touron

Usage

$ find test/ -type f | xargs cryptoguess
test/pem-rsa-pubkey.txt:            potential candidates: PEM encoded data: x509: DER encoded public key, PEM encoded data
test/jwt-token.txt:                 JWT signed token
test/ssh-rsa-authorized-key.txt:    SSH authorized key
test/rsa-pubkey.txt:                potential candidates: BASE64 encoded data: x509: DER encoded public key, BASE64 encoded data
test/crypto-memory/D.der:           x509: PKCS#1 public key (RSA) in ASN.1 DER form
test/crypto-memory/E:               PEM encoded data
test/crypto-memory/A.pub:           SSH authorized key
test/crypto-memory/A:               PEM encoded data
test/crypto-memory/B.pem:           potential candidates: PEM encoded data: x509: PKCS#1 public key (RSA) in ASN.1 DER form, PEM encoded data
test/crypto-memory/B.pub:           SSH authorized key
test/crypto-memory/D.with-password: PEM encoded data
test/crypto-memory/C.pub:           SSH authorized key
test/crypto-memory/D:               potential candidates: PEM encoded data: x509: PKCS#1 private key (RSA) in ASN.1 DER form, PEM encoded data
test/crypto-memory/D.pub:           SSH authorized key
test/crypto-memory/A.der:           x509: PKCS#1 public key (RSA) in ASN.1 DER form
test/crypto-memory/B:               PEM encoded data
test/crypto-memory/C:               PEM encoded data
test/crypto-memory/B.der:           x509: PKCS#1 public key (RSA) in ASN.1 DER form
test/crypto-memory/F.pem:           potential candidates: PEM encoded data: x509: PKCS#1 public key (RSA) in ASN.1 DER form, PEM encoded data
test/crypto-memory/D.pem:           potential candidates: PEM encoded data: x509: PKCS#1 public key (RSA) in ASN.1 DER form, PEM encoded data
test/crypto-memory/F.pub:           SSH authorized key
test/crypto-memory/A.pem:           potential candidates: PEM encoded data: x509: PKCS#1 public key (RSA) in ASN.1 DER form, PEM encoded data
test/crypto-memory/F.der:           x509: PKCS#1 public key (RSA) in ASN.1 DER form
$ find test/ -type f | xargs file
test/pem-rsa-pubkey.txt:            ASCII text
test/jwt-token.txt:                 ASCII text, with very long lines, with no line terminators
test/ssh-rsa-authorized-key.txt:    OpenSSH RSA public key
test/rsa-pubkey.txt:                ASCII text, with very long lines, with no line terminators
test/crypto-memory/D.der:           data
test/crypto-memory/E:               OpenSSH private key
test/crypto-memory/A.pub:           OpenSSH RSA public key
test/crypto-memory/A:               OpenSSH private key
test/crypto-memory/B.pem:           ASCII text
test/crypto-memory/B.pub:           OpenSSH RSA public key
test/crypto-memory/D.with-password: PEM RSA private key
test/crypto-memory/C.pub:           OpenSSH ED25519 public key
test/crypto-memory/D:               PEM RSA private key
test/crypto-memory/D.pub:           OpenSSH RSA public key
test/crypto-memory/A.der:           data
test/crypto-memory/B:               OpenSSH private key
test/crypto-memory/C:               OpenSSH private key
test/crypto-memory/B.der:           data
test/crypto-memory/F.pem:           ASCII text
test/crypto-memory/D.pem:           ASCII text
test/crypto-memory/F.pub:           OpenSSH RSA public key
test/crypto-memory/A.pem:           ASCII text
test/crypto-memory/F.der:           data

$ cryptoguess --debug test/ssh-rsa-authorized-key.txt
test/ssh-rsa-authorized-key.txt: SSH authorized key
- PEM encoded data: err: no PEM data found
- SSH authorized key: *cryptoguess.ParsedSSHAuthorizedKey: &{0xc00005c8c0 lorem ipsum []}
- x509 DER encoded public key: err: asn1: structure error: tags don't match (16 vs {class:1 tag:19 length:115 isCompound:true}) {optional:false explicit:false application:false private:false defaultValue:<nil> tag:<nil> stringType:0 timeType:0 set:false omitEmpty:false} publicKeyInfo @2

$ cryptoguess -h
NAME:
   cryptoguess - A new cli application

USAGE:
   cryptoguess [global options] command [command options] [arguments...]

VERSION:
   0.0.0

COMMANDS:
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --debug, -D    (default: false)
   --list, -l     (default: false)
   --help, -h     show help (default: false)
   --version, -v  print the version (default: false)

Decoders

Encoding Status Recursive
aes 🔴 🔴
ascii85 🔴 🔴
asn1 🔴 🔴
base32 🔴 🔴
base64
cipher 🔴 🔴
csv 🔴 🔴
des 🔴 🔴
dsa 🔴 🔴
ecdsa 🔴 🔴
elliptic 🔴 🔴
encodings (utf-8) 🔴 🔴
encrypted jwt 🔴 🔴
gob 🔴 🔴
gzip,lzw,... 🔴 🔴
json 🔴 🔴
pem
rsa 🔴 🔴
signed jwt 🔴
ssh 🔴
tls 🔴 🔴
url escaped 🔴 🔴
x509: DER certificate list n/a
x509: Elliptic Curve private key n/a
x509: PKCS#1 RSA private key n/a
x509: PKCS#8 private key n/a
x509: PKCS#8 public key n/a
x509: PKIX public key n/a
x509: certificate n/a
x509: certificate list n/a
x509: certificate request n/a
x509: certificates n/a
xml 🔴 🔴

Install

CLI

$ go get -u moul.io/cryptoguess

Library

$ go get -u moul.io/cryptoguess/cryptoguess

As a library

See https://godoc.org/moul.io/cryptoguess/cryptoguess

License

© 2019-2021 Manfred Touron - Apache-2.0 License