Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bok1c4/pgpkeytypedetector
This includes RSA and ECC cryptographic algorithms
https://github.com/bok1c4/pgpkeytypedetector
cryptography go pgp
Last synced: about 1 month ago
JSON representation
This includes RSA and ECC cryptographic algorithms
- Host: GitHub
- URL: https://github.com/bok1c4/pgpkeytypedetector
- Owner: bok1c4
- Created: 2024-10-22T11:42:56.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-10-29T08:32:10.000Z (3 months ago)
- Last Synced: 2024-12-17T00:13:45.692Z (about 1 month ago)
- Topics: cryptography, go, pgp
- Language: Go
- Homepage:
- Size: 1.92 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PGP Key Type Detector
## Overview
PGP Key Type Detector is a Go-based tool designed to detect the type of PGP keys. The program can identify whether the provided key is:- **ECC Public Key**
- **ECC Private Key**
- **RSA Public Key** (PKIX or PKCS1 format)
- **RSA Private Key** (PKCS1 or PKCS8 format)The tool parses keys encoded in PEM format and detects whether the key is a public or private key and whether it's based on **ECC** or **RSA** algorithms.
## Features
- Detects **ECC** (Elliptic Curve Cryptography) keys:
- ECC Public Key
- ECC Private Key
- Detects **RSA** (Rivest–Shamir–Adleman) keys:
- RSA Public Key (both PKIX and PKCS1 formats)
- RSA Private Key (both PKCS1 and PKCS8 formats)## Usage
### Input
The tool takes PEM-encoded keys, with headers such as:
- `-----BEGIN PUBLIC KEY-----` (for public keys)
- `-----BEGIN PRIVATE KEY-----` (for private keys)### Output
The tool returns one of the following:
- **ECC Public Key**
- **ECC Private Key**
- **RSA Public Key** (PKIX format or PKCS1 format)
- **RSA Private Key** (PKCS1 format or PKCS8 format)## Example
```go
myKeys := KeysData{
EcPub: `-----BEGIN PUBLIC KEY-----
(Your ECC public key here)
-----END PUBLIC KEY-----`,
EcPriv: `-----BEGIN PRIVATE KEY-----
(Your ECC private key here)
-----END PRIVATE KEY-----`,
RsaPub: `-----BEGIN PUBLIC KEY-----
(Your RSA public key here)
-----END PUBLIC KEY-----`,
RsaPriv: `-----BEGIN PRIVATE KEY-----
(Your RSA private key here)
-----END PRIVATE KEY-----`,
}keyType, err := kd.DetectKeyType(myKeys.EcPub)
fmt.Println("Detected Key Type:", keyType)