LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-05-2019, 05:02 AM   #1
edomingox
Member
 
Registered: Mar 2009
Posts: 64

Rep: Reputation: 16
openssl hashing results change each time I run it


So I been using this command to match csr's with keys with certificates:

Code:
sudo openssl x509 -noout -modulus -in /etc/pki/tls/certs/localhost.crt | openssl md5
sudo openssl rsa -noout -modulus -in /etc/pki/tls/private/localhost.key| openssl md5
sudo openssl req -noout -modulus -in /etc/pki/tls/certs/hostname.csr | openssl md5
Essentially, all 3 results should match if they go with each other. But for some reason, the results are constantly changing every time I run the same one over and over again. I'm wondering if it has anything to do with CentOS 7.6 or not? I don't remember this ever happening on CentOS 6.9. Any ideas why this is happening?

Edit: I found that on some servers I have, running the same command will produce a hash the first time, then the 2nd time I run it it's different, then the 3rd time will be the same as the 2nd, and from then on out. On another server, I get a different hash every single time. It's strange behavior.

Edit: I ran another test on a server. Testing for the key. I ran the command 10 times. I got a new value every time, except where #5 was the same as #6 and #9 was the same as #10. Though #5 was different than #9. All the other ones were different values.

Last edited by edomingox; 03-05-2019 at 10:48 AM.
 
Old 03-22-2019, 07:28 AM   #2
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
Hi,

This is very strange.
On my CentOS 7.6 box the commands for the key and the certificate return consistently and correctly.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
openssl: any simple examples no how to use openssl to do some decryption? eantoranz Programming 7 07-26-2012 07:57 PM
install of openssl-0.9.8b-8.3.el5 conflicts with file from package openssl-0.9.8b-8.3 jsaravana87 Linux - Server 1 09-26-2011 01:02 PM
oops openssl-0.9.8e over openssl-0.9.8d bad install now 2 copies? rcorkum Slackware 4 06-29-2007 01:58 AM
How to change the hashing algorithm used for passwd kskkumar SUSE / openSUSE 2 06-08-2007 01:38 AM
Change the default hashing algorithm used in SSH kskkumar SUSE / openSUSE 2 06-06-2007 03:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration