Openssl Generate Pgp Public Key

OpenSSL Generate 4096-bit Certificate (Public/Private Key Encryption) with SHA256 Fingerprint
gencert.sh
Key
  • With this PGP key generator, you can generate your own private and public PGP keys. It is also possible to encrypt and decrypt a PGP message. There is no hidden transfer of plain text, and nothing is stored on the server.
  • May 28, 2015 This blog describes how to generate a private/public key pair using GPG version 1.4.5. The resulting public key will contain two keys, one key for signing and a subkey for encryption. This key can be used with HCM Fusion SaaS to encrypt/decrypt files as they are transferred to and from the UCM server.
# Generate Private Key and Certificate using RSA 256 encryption (4096-bit key)
openssl req -x509 -newkey rsa:4096 -keyout privatekey.pem -out certificate.pem -days 365
# Alternatively, setting the '-newkey' parameter to 'rsa:2048' will generate a 2048-bit key.
# Generate PKCS#12 (P12) file for cert; combines both key and certificate together
openssl pkcs12 -export -inkey privatekey.pem -in certificate.pem -out cert.pfx
# Generate SHA256 Fingerprint for Certificate and export to a file
openssl x509 -noout -fingerprint -sha256 -inform pem -in certificate.pem >> fingerprint.txt
# Generate SHA1 Fingerprint for Certificate and export to a file
#openssl x509 -noout -fingerprint -sha1 -inform pem -in certificate.pem >> fingerprint.txt
# FYI, it's best practice to use SHA256 instead of SHA1 for better security, but this shows how to do it if you REALLY need to.

commented Nov 7, 2019

Here's a couple useful links related to this:

/kaspersky-internet-security-2012-key-file-generator.html. Assuming you have the SSH private key idrsa, you can extract the public key from it like so. Openssl rsa -in idrsa -pubout -out idrsa.pub.pem I realize the OP asked about converting a public key, so this doesn't quite answer the question, however I thought it would be useful to some anyway. Jun 09, 2019  The public key is the one you will want to share with others (thus the name “public key”). There are several different ways to generate PGP key pairs; in this article we will be using a program called Gpg4win, also known as Kleopatra.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
public_enc_example.sh
#!/bin/bash
#
# Public-Key Encryption and Decryption
# * http://www.openssl.org/
# * http://barelyenough.org/blog/2008/04/fun-with-public-keys/
#
# Mac OS X 10.6.4
# OpenSSL 0.9.8l 5 Nov 2009
# Generate keys
openssl genrsa -out key.pem
openssl rsa -in key.pem -out key.pub -pubout
# Encrypt and Decrypt a file (using public key to encrypt)
echo --pass-- > pass.txt
openssl rsautl -in pass.txt -out pass.enc -pubin -inkey key.pub -encrypt
openssl rsautl -in pass.enc -out pass.dec -inkey key.pem -decrypt
cat pass.dec
# Compress, Encrypt, Decyrpt, Uncompress a file (using password in pass.txt)
echo content > file.txt
gzip file.txt
openssl bf -in file.txt.gz -out file.enc -pass file:pass.txt -e
openssl bf -in file.enc -out file.dec.gz -pass file:pass.dec -d
gzip -d file.dec.gz
cat file.dec

commented Jan 29, 2018

Generate public key on phone. great share! zelda breath of the wild pal iso download

commented Jul 20, 2019

greate !! thx

Openssl Generate Key File

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment