Skip to main content
63 votes

"No such file or directory" when generating a gpg key

Did you delete the /home/me123/.gnupg directory and then it was recreated by gpg? If so, that's likely what is confusing the agent. Either restart the agent (gpgconf --kill gpg-agent) or, more ...
tupiniquim's user avatar
57 votes
Accepted

SSH: How to disable weak ciphers?

If you have no explicit list of ciphers set in ssh_config using the Ciphers keyword, then the default value, according to man 5 ssh_config (client-side) and man 5 sshd_config (server-side), is: ...
Ulrich Schwarz's user avatar
57 votes

Set default key in gpg for signing

To choose a default key without having to specify --default-key on the command-line every time, create a configuration file (if it doesn't already exist), ~/.gnupg/gpg.conf, and add a line containing ...
Stephen Kitt's user avatar
56 votes
Accepted

How to zip directory with encryption for file names?

In a zip file, only file contents is encrypted. File metadata, including file names, is not encrypted. That's a limitation of the file format: each entry is compressed separately, and if encrypted, ...
Gilles 'SO- stop being evil''s user avatar
48 votes

SSH: How to disable weak ciphers?

To disable RC4 and use secure ciphers on SSH server, hard-code the following in /etc/ssh/sshd_config ciphers [email protected],[email protected],[email protected],aes256-ctr,...
savageBum's user avatar
  • 589
44 votes

How to set password for pdf files?

pdftk depends on old libraries, and so is no longer in the repos of Fedora / CentOS. As a replacement, I prefer qpdf qpdf --encrypt [readpass] [ownerpass] 256 -- [infile].pdf [outfile].pdf
resplin's user avatar
  • 553
41 votes
Accepted

Is this a zip encryption bug?

Zip archives can have multiple passwords for different contained files. Files within an archive are essentially independent of each other - they are compressed without regard for other files, and they ...
Michael Homer's user avatar
38 votes

How to create SHA512 password hashes on command line

OpenSSL has openssl passwd -6 Help says: $ openssl passwd --help Usage: passwd [options] Valid options are: ... -6 SHA512-based password algorithm For consistent output you can ...
Markus Linnala's user avatar
38 votes

SSH: How to disable weak ciphers?

The problem with explicitly specifying a cipher list is that you must manually add new ciphers as they come out. Instead, simply list the ciphers you want to remove, prepending the list (not each ...
Spacedog's user avatar
  • 556
36 votes
Accepted

Pre-encryption wipe, why?

There is no point in doing multiple passes. Once is enough. Filling a to-be-encrypted drive with random data mainly has two uses: get rid of old, unencrypted data make free space indistuingishable ...
frostschutz's user avatar
  • 49.5k
28 votes
Accepted

OpenSSL 1.1.1b warning: Using -iter or -pbkdf2 would be better while decrypting a file encrypted using OpenSSL 1.1.0g

Comparing the Synopsys of the two main and recent versions of OpenSSL, let me quote the man pages. OpenSSL 1.1.0 openssl enc -ciphername [-help] [-ciphers] [-in filename] [-out filename] [-pass arg] [...
Vlastimil Burián's user avatar
24 votes

Is there a way to encrypt disk without formatting it?

Yes, there is a way. The LUKS cryptsetup utility contains the reencrypt command that you can also use to encrypt your existing unencrypted root partition, i.e. without destroying the existing ...
maxschlepzig's user avatar
  • 57.8k
22 votes

How to remove LUKS encryption?

Removing key-slots is like forgetting a password, it has nothing to do with moving the replacing the LUKS device by the filesytem inside of it. You CAN non-destructively remove the LUKS encryption ...
Chen She's user avatar
  • 269
22 votes
Accepted

mount: No such file or directory with encrypted recovery

I found that running sudo bash and then running ecryptfs-recover-private as root (rather than via sudo) worked. Not sure why it should be any different. Edit: TL;DR: # ecryptfs-unwrap-passphrase /...
Doctor J's user avatar
  • 671
22 votes
Accepted

Encrypting whole disk with Luks (instead of one big encrypted partition)

The cryptsetup FAQ mentions whole-disk encryption using LUKS. Basically, cryptsetup doesn’t care what the LUKS device is, partition, disk, or loop device, so you can use whichever is appropriate. ...
Stephen Kitt's user avatar
19 votes

"No such file or directory" when generating a gpg key

It would appear that the directory ~/.gnupg/private-keys-v1.d (under some circumstances) is not being created or, is created with the wrong permissions. # mkdir -p ~/.gnupg/private-keys-v1.d # chmod ...
Alien Life Form's user avatar
18 votes
Accepted

How to mount and de-encrypt a LUKS encrypted partition to recover files

To recover your files you will first need to open your LUKS container. This will make your LVM logical volumes accessible. Then, you can mount the appropriate logical volume to gain access to the ...
Emmanuel Rosa's user avatar
17 votes

How to remove LUKS encryption?

Firstly, when removing a passphrase from a LUKS partition, you need to specify the disk partition where it resides, like: cryptsetup luksRemoveKey /dev/sda2 And when you want the status from a LUKS-...
pepa65's user avatar
  • 271
16 votes

How to determine what encryption is being used a LUKS partition?

List the disks: lsblk --fs Then (used encryption): cryptsetup luksDump /dev/sdb1 Or (used encryption): cryptsetup status crypt_sdb1 In addition (kernel supported encryption and bench): cat /...
intika's user avatar
  • 14.6k
16 votes
Accepted

How do you generate an .asc file from pgp public key?

Usually, a .asc file is an ASCII-armored representation of key material (or a signature). Your shirish-public-key.txt looks like it’s just that, so if you’re sure it contains the right information you ...
Stephen Kitt's user avatar
15 votes

The format of encrypted password in `/etc/shadow`

The answer to "What is the meaning of the parts of the crypt(3) function": id param salt hash As explained more in detail here. Regarding the new yescrypt "passphrase hashing scheme&...
7heo.tk's user avatar
  • 251
15 votes
Accepted

What is the epoch of LUKS that is shown when running luksDump?

The Epoch increases every time you change anything in your LUKS header (like when adding or removing keys, etc.). The LUKS2 header specification states: uint64_t seqid; // sequence ID, increased on ...
frostschutz's user avatar
  • 49.5k
14 votes

Password encryption and decryption

Encrypting a password is useless when you can't keep it encrypted. The instant you decrypt it, it's vulnerable again. No matter how cryptographically hard they are, the encryption and decryption ...
Rahul's user avatar
  • 13.7k
14 votes
Accepted

gpg: cancelled by user

As to the "cancelled by user" error: GnuPG tries to make sure it's reading the passphrase directly from the terminal, not (e.g.) piped from stdin. To do so, it tries to open the tty directly. ...
derobert's user avatar
  • 110k
14 votes
Accepted

ZFS encrypted pool on Linux?

Encryption was added to ZFS On Linux with the release of version 0.8. So you need at least that version. In ZFS, encryption is on a per-dataset basis, not on a pool - but, as with most things in ZFS, ...
cas's user avatar
  • 79k
14 votes
Accepted

How to disable weak HMAC Algorithms? Not found in ssh_config or sshd_config file

The list of supported MAC algorithms is determined by the MACs option, both in ssh_config and in sshd_config. If it's absent, the default is used. If you want to change the value from the default, ...
Gilles 'SO- stop being evil''s user avatar
13 votes
Accepted

Why can one box decrypt a file with openssl, but another one can't?

The default hash used by openssl enc for password-based key derivation changed in 1.1.0 to SHA256 versus MD5 in lower versions. This produces a different key from the same password (and salt if used ...
dave_thompson_085's user avatar
13 votes

What is in this directory $HOME/.gnupg/private-keys-v1.d ? And where are the private keys stored?

From man gpg of GPG version 2.2.12 (emphasis mine): --secret-keyring file This is an obsolete option and ignored. All secret keys are stored in the ‘private-keys-v1.d’ directory below the GnuPG home ...
telcoM's user avatar
  • 99.5k
13 votes
Accepted

What's the encryption type $y$ used in /etc/passwd on Kali Linux?

From man 5 crypt, AVAILABLE HASHING METHODS yescrypt yescrypt is a scalable passphrase hashing scheme designed by Solar Designer, which is based on Colin Percival's scrypt. Recommended for new ...
steeldriver's user avatar
  • 81.7k
13 votes
Accepted

What does j9T mean in yescrypt (from /etc/shadow)?

Disclaimer Below are my own findings and the way I interpreted them without having an expert understanding of cryptography and the concepts involved. Signatures Notably, as the yescrypt CHANGES file ...
NULLx's user avatar
  • 146

Only top scored, non community-wiki answers of a minimum length are eligible