https://github.com/saidone75/clj-ssh-keygen
Generate RSA PKCS #1 key-pairs from scratch (without 3rd party libs) in Clojure
https://github.com/saidone75/clj-ssh-keygen
authentication cryptography keygen keypair ssh ssh-key
Last synced: 3 months ago
JSON representation
Generate RSA PKCS #1 key-pairs from scratch (without 3rd party libs) in Clojure
- Host: GitHub
- URL: https://github.com/saidone75/clj-ssh-keygen
- Owner: saidone75
- License: mit
- Created: 2020-05-09T16:30:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-01T06:02:12.000Z (over 1 year ago)
- Last Synced: 2025-10-21T23:58:10.562Z (3 months ago)
- Topics: authentication, cryptography, keygen, keypair, ssh, ssh-key
- Language: Clojure
- Homepage: https://saidone.org
- Size: 88.9 KB
- Stars: 16
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clj-ssh-keygen
[](https://clojars.org/clj-ssh-keygen)
[](https://cljdoc.org/d/clj-ssh-keygen/clj-ssh-keygen)
Generate RSA PKCS #1 keys **from scratch** and **without 3rd party libs** in Clojure, export **PEM** and **OpenSSH** formats
*☛ intended for hacking and educational purposes only!*

## Usage
```clojure
(let [key (generate-key)]
(write-private-key! key "pvt.pem")
(write-public-key! key "pub.pem")
(write-openssh-public-key! key "id_rsa.pub")))
```
for generating a default (2048 bit) length key, while:
```clojure
(write-private-key! (generate-key 2345) "pvt.pem")
```
will issue a custom length key:
```console
$ openssl rsa -noout -text -in pvt.pem|head -n 1
RSA Private-Key: (2345 bit, 2 primes)
```
## License
Copyright (c) 2020-2024 Saidone
Distributed under the MIT License