Cryptography provides security mechanisms that are based on algorithmic methods and not on policy enforcement. For questions on cryptographic mechanisms and their application the Cryptography SE resp. the Information Security SE are most likely more appropriate. Don't use this tag if your question is about software that uses cryptographic mechanisms but not about cryptography itself.
Questions tagged [cryptography]
80 questions
43
votes
5 answers
How can I get a base64 encoded shaX on the cli?
sha1sum outputs a hex encoded format of the actual sha. I would like to see a base64 encoded variant. possibly some command that outputs the binary version that I can pipe, like so: echo -n "message" | | base64 or if it outputs it…
xenoterracide
- 57,918
- 74
- 184
- 250
33
votes
4 answers
How do I tell which GPG key an RPM package was signed with?
The cryptographic signature of an RPM can be verified with the rpm -K command. This returns a string containing gpg (or pgp) and ending in OK if the signature is in RPM's database and is valid.
If the package is not signed but the checksums are…
mattdm
- 39,535
- 18
- 99
- 133
21
votes
3 answers
How can I force /dev/random to block?
For a class on cryptography, I am trying to drain the entropy pool in Linux (e.g. make /proc/sys/kernel/random/entropy_avail go to 0 and block a command reading from /dev/random) but I can't make it happen. I'm supposed to get reads from /dev/random…
John Phillips
- 213
- 2
- 4
18
votes
2 answers
What is the difference between /etc/ssh/ and ~/.ssh?
I’m having fun with OpenSSH, and I know the /etc/ssh directory is for the ssh daemon and the ~/.ssh directory is for a particular user.
Both directories contain private and public keys:
But what is the difference between those keys? I’m confused…
Kavish Gour
- 303
- 1
- 3
- 7
15
votes
2 answers
Why aren't the Fedora GPG keys signed?
Fedora uses GPG-keys for signing RPM packages and ISO checksum files. They list the keys in use (including fingerprints) on a web page. The web page is delivered via https.
For example the checksum file for Fedora-16-i386-DVD.iso is signed with key…
maxschlepzig
- 56,316
- 50
- 205
- 279
10
votes
1 answer
Cli verification of digitally signed email
I am Alice and I've received signed email from Bob.
I use Web e-Mail client (e.g. GMail) and I see that one of attachements is smime.p7s.
I've found option "show original message" and saved contents into message.orig.
Assuming Bob signed email, how…
Grzegorz Wierzowiecki
- 13,865
- 23
- 89
- 137
10
votes
5 answers
Program for decrypt linux shadow file
Is there any program or script available for decrypt Linux shadow file ?
Kumar
- 893
- 6
- 18
- 24
6
votes
1 answer
RIPEMD-160 file digest
How can I make a file digest under Linux with the RIPEMD-160 hash function, from the command line?
Grzegorz Wierzowiecki
- 13,865
- 23
- 89
- 137
5
votes
1 answer
Using kernel cryptographic functions
Is it possible to use kernel cryptographic functions in the userspace? Let's say, I don't have md5sum binary installed on my system, but my kernel has md5sum support. Can I use the kernel function from userspace? How would I do it?
Another scenario…
Martin Vegter
- 69
- 66
- 195
- 326
5
votes
1 answer
What is the correct partition type for a geli-crypted partition on FreeBSD?
I am currently in the process of setting up an encrypted homeserver with zfs and geli.
However I am not sure what the correct partition type for geli-crypted filesystems are.
Do I just take 'freebsd-zfs' like I would do for a noncrypted zfs…
phryk
- 53
- 3
4
votes
2 answers
generate Token for OAuth (Twitter)
I am writing a simple bash script to download stream from Twitter:
curl -H "Authorization: ${TOKEN}" "$URL"
and I am looking for a way to generate the $TOKEN. I have all the input necessary (CONSUMER_KEY, ...), but where can I get the program…
Martin Vegter
- 69
- 66
- 195
- 326
4
votes
1 answer
Verifying a hashed salted password that uses yescrypt algorithm
In order to verify a password hash we can use openssl passwd as shown below and explained here
openssl passwd $HASHING-ALGORITHM -salt j9T$F31F/jItUvvjOv6IBFNea/ $CLEAR-TEXT-PASSWORD
However, this will work only for the following algorithm: md5,…
MasterOfTheHouse
- 165
- 1
- 5
4
votes
3 answers
How to do HmacSHA256 using openSSL from terminal?
I need to perform the following Java snippet using OpenSSL from the command line:
private byte[] hmacSha256(byte[] key, byte[] payload) throws GeneralSecurityException {
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new…
Stefano
- 171
- 1
- 1
- 6
4
votes
1 answer
How to restore GnuPG key after reinstall?
I know that GnuPG is all about security, thus it's not giving many chance of retrieve private keys (otherwise anyone could do it) but I've got a private key, and my own rev.asc file.
I had to reinstall my Ubuntu box (former Ubuntu Studio) and I have…
dag729
- 241
- 2
- 6
4
votes
2 answers
How to encyrpt a message using someone's SSL smime.p7s file
I need to send a private key file to someone (a trusted sysadmin) securely. I suggested a couple options, but he replied as follows:
Hi, I don't have neither LastPass nor GnuPGP but I'm using ssl
certificates - this message is signed with such so…
MountainX
- 17,168
- 59
- 155
- 264