Skip to content

Instantly share code, notes, and snippets.

@alopresto
Last active September 25, 2019 03:45
Show Gist options
  • Save alopresto/b91c731b347584316fa4d3ca37ba256c to your computer and use it in GitHub Desktop.
Save alopresto/b91c731b347584316fa4d3ca37ba256c to your computer and use it in GitHub Desktop.
CLI output from performing GPG El Gamal exploration for NiFi PGP integration.
...rkspace/scratch/ (master) πŸ˜‰
πŸ”’ 0s @ 17:39:57 $ gpg --no-default-keyring --keyring ./nifi-unit-test-small-dsa.gpg --full-generate-key -vv
gpg: keybox './nifi-unit-test-small-dsa.gpg' created
Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
Your selection? 2
DSA keys may be between 1024 and 3072 bits long.
What keysize do you want? (2048) 1024
Requested keysize is 1024 bits
Please specify how long the key should be valid.
0 = key does not expire
<n> = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0) 0
Key does not expire at all
Is this correct? (y/N) y
GnuPG needs to construct a user ID to identify your key.
Real name: NiFi Test DSA/EG Key Pair
Email address: test_1024@nifi.apache.org
Comment: Unit test resource for OpenPGPKeyBasedEncryptor - 1024 bytes
You selected this USER-ID:
"NiFi Test DSA/EG Key Pair (Unit test resource for OpenPGPKeyBasedEncryptor - 1024 bytes) <test_1024@nifi.apache.org>"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: pinentry launched (33235 mac 1.1.0 /dev/ttys003 xterm -)
gpg: pinentry launched (33239 mac 1.1.0 /dev/ttys003 xterm -)
gpg: writing self signature
gpg: DSA/SHA512 signature from: "5EAEA4BD55F50049 [?]"
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: writing key binding signature
gpg: DSA/SHA512 signature from: "5EAEA4BD55F50049 [?]"
gpg: writing public key to './nifi-unit-test-small-dsa.gpg'
gpg: using pgp trust model
...
gpg: key 5EAEA4BD55F50049: accepted as trusted key
gpg: key 5EAEA4BD55F50049 marked as ultimately trusted
gpg: writing to '/Users/alopresto/.gnupg/openpgp-revocs.d/5181CFEA8F9C996ADC6869255EAEA4BD55F50049.rev'
gpg: DSA/SHA512 signature from: "5EAEA4BD55F50049 NiFi Test DSA/EG Key Pair (Unit test resource for OpenPGPKeyBasedEncryptor - 1024 bytes) <test_1024@nifi.apache.org>"
gpg: revocation certificate stored as '/Users/alopresto/.gnupg/openpgp-revocs.d/5181CFEA8F9C996ADC6869255EAEA4BD55F50049.rev'
public and secret key created and signed.
pub dsa1024 2019-09-25 [SC]
5181CFEA8F9C996ADC6869255EAEA4BD55F50049
uid NiFi Test DSA/EG Key Pair (Unit test resource for OpenPGPKeyBasedEncryptor - 1024 bytes) <test_1024@nifi.apache.org>
sub elg1024 2019-09-25 [E]
...rkspace/scratch/ (master) πŸ˜‰
πŸ”’ 0s @ 20:24:42 $ gpg --version
gpg (GnuPG/MacGPG2) 2.2.17
libgcrypt 1.8.4
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Home: /Users/alopresto/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
...rkspace/scratch/ (master) πŸ˜‰
πŸ”’ 1s @ 20:30:49 $ echo "This is a plaintext file to be encrypted with El Gamal." > plain_eg.txt
...rkspace/scratch/ (master) πŸ˜‰
πŸ”’ 19102s @ 20:31:46 $ gpg --no-default-keyring --keyring ./nifi-unit-test-small-dsa.gpg --fingerprint --list-sigs -vv
gpg: using pgp trust model
...
gpg: key 5EAEA4BD55F50049: accepted as trusted key
gpg: checking the trustdb
gpg: 29 keys processed (30 validity counts cleared)
...
gpg: marginals needed: 3 completes needed: 1 trust model: pgp
gpg: depth: 0 valid: 10 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 10u
./nifi-unit-test-small-dsa.gpg
------------------------------
pub dsa1024 2019-09-25 [SC]
5181 CFEA 8F9C 996A DC68 6925 5EAE A4BD 55F5 0049
uid [ultimate] NiFi Test DSA/EG Key Pair (Unit test resource for OpenPGPKeyBasedEncryptor - 1024 bytes) <test_1024@nifi.apache.org>
sig 3 5EAEA4BD55F50049 2019-09-25 NiFi Test DSA/EG Key Pair (Unit test resource for OpenPGPKeyBasedEncryptor - 1024 bytes) <test_1024@nifi.apache.org>
sub elg1024 2019-09-25 [E]
sig 5EAEA4BD55F50049 2019-09-25 NiFi Test DSA/EG Key Pair (Unit test resource for OpenPGPKeyBasedEncryptor - 1024 bytes) <test_1024@nifi.apache.org>
...rkspace/scratch/ (master) πŸ˜‰
πŸ”’ 0s @ 20:32:07 $ gpg --no-default-keyring --keyring ./nifi-unit-test-small-dsa.gpg -ear 55F50049 plain_eg.txt
...rkspace/scratch/ (master) πŸ˜‰
πŸ”’ 0s @ 20:32:44 $ more plain_eg.txt.asc
-----BEGIN PGP MESSAGE-----
hQEOA+l1pmiuJVbWEAQAjTxDe/8XxbnvrKRyGwmIrCGjVQOYPSNTXyJ3GRfeT6rE
G9SFzhRRRUn8sauF59D8K0PJdVp/81yCoVSAzG4luDAUXpyoPMh8HH82YqJ+j2Pm
s9k/glviClnj21+BIcKIWq1GJ2qFrxHCe52vc5x0GluoYxP+r+5HN5d47VPrZLcE
AI/D18vHZDVL0mPFLM9Rew5V++3cXhD2KLrpQmlt50qAEQl5eWmRprz2VICZs5qZ
NVQcww6iWqmXnwprWnGo7PRQnzX8ExJ5iqFDBnOVE7cA8FLWZrDHl45ojyup/Twa
KEIcF2GUoo+tkvrNh0ZMux5m3RfEGt+F9w6WwNouyIc60noBf612tvucW5pOAB/r
KVUcnCEBYqQcxS1wgG3ZqtHUxth34c8jCIBcI+ERMuBGmENuG99rds+S/8xSoC0P
CKF3DagwtRqgYd8KNZxcTDSJMg5j8YK6/Z/ecXPC8VV+ssQA9M8CF8jIVErYP+HC
3scQkdTfBUk0ZxNW8g==
=LF/k
-----END PGP MESSAGE-----
...rkspace/scratch/ (master) πŸ˜‰
πŸ”’ 2s @ 20:32:54 $ gpg --no-default-keyring --keyring ./nifi-unit-test-small-dsa.gpg -da plain_eg.txt.asc
gpg: encrypted with 1024-bit ELG key, ID E975A668AE2556D6, created 2019-09-25
"NiFi Test DSA/EG Key Pair (Unit test resource for OpenPGPKeyBasedEncryptor - 1024 bytes) <test_1024@nifi.apache.org>"
This is a plaintext file to be encrypted with El Gamal.
...rkspace/scratch/ (master) πŸ˜‰
πŸ”’ 6s @ 20:33:19 $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment