LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 02-04-2022, 03:40 PM   #1
mia_tech
Member
 
Registered: Dec 2007
Location: FL, USA
Distribution: CentOS 5.3, Ubuntu 9.04
Posts: 245

Rep: Reputation: 16
What Is the Difference Between Checking for Integrity and Authenticity of an ISO File


I'm downloading the latest version of linux mint and towards the bottom of the download page they have an integrity and authenticity key.
the integrity I know why we check it. to know that the image has not been tampered with, but why run a gpg command against the iso image. As far as I know gpg is for encryption. here's the link to the page

https://linuxmint.com/edition.php?id=293
 
Old 02-04-2022, 03:53 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,278
Blog Entries: 24

Rep: Reputation: 4225Reputation: 4225Reputation: 4225Reputation: 4225Reputation: 4225Reputation: 4225Reputation: 4225Reputation: 4225Reputation: 4225Reputation: 4225Reputation: 4225
Checking integrity, such as a checksum, lets you know the file was not corrupted during download or modified at any time since it was produced.

Checking authenticity, such as via GPG, lets you know that it is in fact the very file produced and signed by the source.

The reason both are necessary is that a malperson with access could modify both the file and the published checksum, so that the checksum you check would be correct while the file had been tampered with or replaced, but they should not be able to sign the forgery with the orgin key.

Last edited by astrogeek; 02-04-2022 at 03:57 PM.
 
4 members found this post helpful.
Old 02-06-2022, 04:28 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
linuxmint.com was hacked a while ago, so I guess they learned their lesson and are extra careful now.
 
Old 03-01-2022, 08:12 AM   #4
mia_tech
Member
 
Registered: Dec 2007
Location: FL, USA
Distribution: CentOS 5.3, Ubuntu 9.04
Posts: 245

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by astrogeek View Post
The reason both are necessary is that a malperson with access could modify both the file and the published checksum, so that the checksum you check would be correct while the file had been tampered with or replaced, but they should not be able to sign the forgery with the orgin key.
if I understand correctly the sha256sum.txt.gpg is the signature of the iso file or the sha256sum file which is a key. I know that gpg is a signature file. well gpg (good privacy) is an encryption program that generates a private key and a public key. which is posted on the iso download file? the public? and then you have to check against the private key uploaded to a server? therefore validating the authenticity of the person who signed the file? what if the malicious attacker posted its own gpg key?
 
Old 03-01-2022, 08:22 AM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,706
Blog Entries: 19

Rep: Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506
Quote:
Originally Posted by mia_tech View Post
Which is posted on the iso download file? the public?
That's right, more or less. It isn't included in the file, but it's available separately for the package manager to use in checking.
Quote:
and then you have to check against the private key uploaded to a server?
Not quite. The private key, used to sign packages, stays on the maintainer's computer. Only the public key is made available to users.
Quote:
therefore validating the authenticity of the person who signed the file? what if the malicious attacker posted its own gpg key?
There was a scare about this in the Slackware forum last year https://www.linuxquestions.org/quest...ed-4175694561/. Someone pointed out that the public key available for packages could be spoofed. A bad actor could sign contaminated packages with his own private key and see to it that the public key supplied to users was the corresponding one. The solution was and is to provide the correct public keys from a different well-guarded machine, not the one used to host the repository.

Last edited by hazel; 03-01-2022 at 08:39 AM.
 
Old 03-01-2022, 08:52 AM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,708
Blog Entries: 4

Rep: Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949
"Digital signing" is one of the many services offered by GPG/PGP®, and it basically works like this:

A trusted party calculates a strong checksum, such as SHA1, then encrypts that checksum using its private key and attaches it to the file. He then publishes a copy of the corresponding public key. In order to verify the contents of the file, you first decrypt the checksum using the public key – thereby confirming that in fact you can successfully do so – and then compare your calculated checksum to the decrypted value.

All encrypted messages are also signed as a matter of course, but unencrypted content can also be signed.

Public keys are usually stored in "key repositories" which endeavor to vouch for the origins of the parties who place the keys, but reducto ad absurdum is still possible: theoretically, you could fake content, sign it with a fake private key, and publish it using a fake public key – otherwise known as "an imposter." Good until you get caught.

A public key file also contains identifying metadata which cannot be altered unless you possess the corresponding private key.

Last edited by sundialsvcs; 03-02-2022 at 08:18 AM.
 
Old 03-01-2022, 12:52 PM   #7
mia_tech
Member
 
Registered: Dec 2007
Location: FL, USA
Distribution: CentOS 5.3, Ubuntu 9.04
Posts: 245

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by sundialsvcs View Post
"
Public keys are usually stored in "key repositories" which endeavor to vouch for the origins of the parties who place the keys, but reducto ad absurdum is still possible: theoretically, you could fake content, sign it with a fake private key, and publish it using a fake public key – otherwise known as "an imposter." Good until you get caught.
ok, so when it comes about public key publish next to iso download is to verify the authenticity of the publisher (gpg signature) not the files itself. Is to verify he is who he says he is? b/c is more difficult to alter the iso image and sha256sum key and at the same time tamper with the gpg signature? why the don't call it a signature then? that's why threw me off
 
Old 03-02-2022, 05:11 AM   #8
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,706
Blog Entries: 19

Rep: Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506
On the site you have the software file itself, a hash of it, and a "signature file". This is the hash encrypted with the maintainer's private key which never leaves his machine.

The package manager downloads all three files and decrypts the signature file using the distro's public key which is stored somewhere on your machine. If the result is identical to the unencrypted hash, then the signature file was definitely signed by the maintainer and the hash must be the one the maintainer made from his reliable copy of the package file. It has not been replaced by a new hash from somebody else's dishonestly modified version. Next that hash file is checked against a new hash of your downloaded package. If they are identical, then the package has not been tampered with either, nor has it been corrupted in the download. You can install it safely.
 
  


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
[SOLVED] Win 7 - How to Verify the authenticity of the sha256sum.txt file RavenCarillon Linux - Newbie 8 07-23-2019 11:19 AM
LXer: How to verify the authenticity and integrity of a downloaded file on Linux LXer Syndicated Linux News 0 10-16-2014 05:11 PM
mounting CDs and checking file integrity usnatarajan Linux - Hardware 1 12-23-2009 01:32 PM
Which are some really good file integrity checking programs? abefroman Linux - Security 13 04-03-2008 12:41 PM
file integrity checking software??? dsids Linux - Newbie 2 08-21-2006 07:49 AM

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

All times are GMT -5. The time now is 09:21 AM.

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