doing some search on the terminal - finding files and more..
good evening dear friends,
first of all - i hope your are all right and everything goes well at your site!!
wll i need to find all the keys on my machine - on a linux-notebook
i want to work with the keys - and want to decrypt things - for example a crypted mssg. Well that said - i think that i need to first do some - hmmm lets say preliminary things. i need to check if i have gpg on the machine.
but well -ts there:
Code:
$ gpg --version
gpg (GnuPG) 2.2.12
libgcrypt 1.8.4
Copyright (C) 2018 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: /home/martin/.gnupg
Unterst?tzte Verfahren:
?ff. Schl?ssel: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Verschl?.: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Komprimierung: nicht komprimiert, ZIP, ZLIB, BZIP2
(base) martin@mx:~
duhhh - i am very glad that its there : well if it would be missing on the box i would need to install it with the package manager (for example sudo apt install gnupg). But i am pretty sute that the keys do not mis - i have a lot of them here.
but - generallly spoken (and this might be usefful for others - if they step through the whole process.
we could ..../we should. :
b. Import my (or just say "the") private key (especially then if not already in your keyring). If i have a backup key file (often something like private.asc), we might import it with:
Code:
gpg --import private.asc
And besides this we also might list what keys are already available with:
Code:
gpg --list-secret-keys
but - hmm i do not have found any (!!!) key at all - this makes me wonder!"?
why is this the case!? i am doing further checks and will come back here - and report all i have found
update: ... well dear Demanding Truth, dear MichaelK - well since i did not find the keys i need to do some extra work - i need to generate a new set of keys..:
in fact: i did not find the keys - so i have to start over: since the old private key is missing, i guess that the cleanest approach would here to generate a brand-new keypair, and that sai - to keep the private key safe, and afterwards - to send to my friends the public key so they can re-encrypt messages to me - and we can exchange messages in the future.
in case any other user here has the same issues - i write down the steps in the process to generate the new key: - so this might be (hopefully) helpful to others too:
here we have the process: for the process if we are on Linux the recommended way would be - hmm:
we have to firstly do the important step:
1. Install GnuPG (if not already this exists)
we ought to check with the following command:
Well and now it goes - if it?s missing, then we need to install the stuff (and if we are on EOS - an Arch based Linux then it might be like so):
Code:
sudo pacman -S gnupg
and then - if the stuff is installed - we could go further and
2. Generate a new key
here we need to run:
Code:
gpg --full-generate-key
and it goes further: here - in that place we are asked a few things:
Key type: just press Enter for the default (RSA and RSA).
Key size: choose 4096 bits (strong, standard today).
Expiration: either set an expiry (e.g., 2y) or choose "0" for never. Expiry is good for security.
Name + Email: enter something meaningful so our friend can recognize you.
Comment: optional - this is not totally necessary - i leave it open ... you can do it like me ;)
Passphrase: hmm - i think it is important to choose a strong passphrase ? this protects our private key.
3. List our new key
After generation, check:
we ?ll see an entry with our name/email.
4. and now - here in this step we are able to export our public key (to send to our friend)
To export and save it as a file:
note; the so called --armor makes it to a ASCII text so we can email or paste it safely.
on and on it goes: in the next step - we are able to
5. Send the public key
now we can send mykey.pub to our friends (email, messenger, whatever).
⚠️ Never send the private key ? only the .pub.
6. (Optional but smart) Backup our private key
Export our private key and store it securely (offline, encrypted USB, etc.):
gpg --armor --export-secret-keys [email protected] > mykey-private.asc
well i wrote this down here - to share it wiht all of you - i hope that it might be helpful for others too. For me its helpful to write down the things. It helps me to make things clearer..
hth others too
- greetings