Collision: 一个验证你的文件是否被篡改的开源应用
哈希 校验 MD5

> 
> 一个让你查看你的文件哈希值，以确定它不是恶意文件，并且确实来自真实来源的图形界面程序。
> 
> 
> 


![](/data/attachment/album/202204/06/101130edund6qvmdmw0nd0.jpg)


有人给你发送了一个文件，你怎样来证实它是给你的原件？你怎样来确定它没有被篡改过？


同时，你怎么证实这个文件是来自一个原始的真实来源。


这就是加密哈希的重要作用所在。如果用来验证一个文件，诸如 SHA-1 之类的哈希功能就是一个校验值。这能够帮助你确认文件是否已经被修改。


如果你感到好奇，你可以参考我们的 [在 Linux 中验证校验值的指南](https://itsfoss.com/checksum-tools-guide-linux/)。


对每个信息 / 文件来说，它们有一个唯一的哈希值（或者叫校验和）。所以，即使文件有一点点的改动，整个哈希值就会发生变化。


它主要用于加密中，每个文件 / 信息以哈希值安全的存储。假设一个攻击者掌握了存储哈希值（而不是真实信息）的数据库，他们也不能够知道其意义。加密可以使存储更加安全。


虽然讨论哈希超出了这篇文章的范围，但是了解它在验证文件完整性上是很有意义的。


### Collision：迅速的验证文件并发现恶意文件


![](/data/attachment/album/202204/06/101132f37arbn0a0ss55sy.png)


如果没有图形界面，你就得用终端去生成哈希值来比对 / 验证。


Collision 使它变的非常容易，不需要打开终端或者生成文件的校验值。如果你不了解的话，我们的 [在 Linux 中验证校验值的指南](https://itsfoss.com/checksum-tools-guide-linux/) 可以帮助到你。


当使用 Collision 时, 你只需要添加你要生成哈希值或者验证所需的文件即可。你只需点击几下便能够保护自己免受恶意或篡改文件的攻击。


我在截图中显示了个文本文件，你的文件在发送给其他人之前，你可以验证各种类型文件或为你的文件生成一个哈希值。你可以通过发给收件人分享你生成的哈希值，让他们验证你的文件。


![](/data/attachment/album/202204/06/101132beq64lt1cf4ruuzs.png)


这是一款简单的开源应用，它只帮你做两件事情：


* 生成哈希值（SHA-1、MD5、SHA-256、SHA-516）
* 通过直接使用文件或者校验值验证一个项目


### Collision 是怎么工作的


给你举个例子，我修改原来的文本文件，为其添加一个字母，然后尝试验证它。


下面是它的过程：


首先，你需要打开你要比对的原文件或者有校验值的原文件。


打开原文件生成哈希值，然后去验证区查看修改后的文件。


![](/data/attachment/album/202204/06/101132ho9y0opxx8o0hxyo.png)


你会注意到，它们俩个不是相同的：


![](/data/attachment/album/202204/06/101133i46kyq62taqmwy44.png)


如果你在按校验值检查文件，首先，你要打开你要验证的文件（这儿是我们已经修改后的文件）。


![](/data/attachment/album/202204/06/101133pztl7y0tqrs6m9l6.png)


然后，输入文件的原始真实校验值。当然我们已经知道我们测试的是修改后的文件，结果是我们所期望的，即，**验证文件完整性失败**。


![](/data/attachment/album/202204/06/101133k8qo9j96898oioq6.png)


### 在 Linux 安装 Collision


Collisions 主要是一个为 GNOME 定制的程序，但是它也适用于其他发行版上。


你可以使用 [Flatpak 可用软件包](https://flathub.org/apps/details/dev.geopjr.Collision) 来安装它，或者浏览 GitHub 网页，从源码中编译它。如果你是 Linux 新手，你可以参考我们的 [Flatpak 指南](https://itsfoss.com/flatpak-guide/) 来得到帮助。


如果你喜欢使用终端来安装，键入以下命令来安装：



```
flatpak install flathub dev.geopjr.Collision

```

你也可以访问它的官方网站。



> 
> [Collision](https://collision.geopjr.dev/)
> 
> 
> 




---


via: <https://itsfoss.com/collision/>


作者：[Ankush Das](https://itsfoss.com/author/ankush/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[hwlife](https://github.com/hwlife) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
*B***rief:** A GUI program to let you check hash for your files to ensure that it is not malicious and true to its source.

Someone sends you a file, how do you verify that it’s the original one meant for you? How can you be certain that it hasn’t been tampered with?

Moreover, how can you verify that the file comes from an original source?

That’s where cryptographic hash functions come in. A hash function (such as SHA-1) is a checksum if it is used to verify a file. This helps you confirm whether the file has been modified or not.

If you are curious, you can refer to our [guide on verifying checksum in Linux](https://itsfoss.com/checksum-tools-guide-linux/).

For every information/file, there will be a unique hash value (or checksum). So, even if a tiny bit of the file changes, the hash value changes entirely.

It’s primarily used in encryption, where every file/information is stored securely as hash values. Suppose an attacker gets hold of the database with hash values (instead of the real information), they cannot make sense of it. And, this is how encryption makes things secure.

While discussing hashing is beyond the scope of this article, it is important to know that it comes in handy when verifying the integrity of a file.

## Collision: Easily Verify a File and Spot Malicious Files

![collision](https://itsfoss.com/content/images/wordpress/2022/04/collission-verify-true.png)

Without a GUI, you will have to use the terminal to generate hash values to compare/verify.

Collision makes it incredibly easy, without needing to launch a terminal or knowing to generate checksum values of a file. If you are not aware of it, our [tutorial on verifying checksum in Linux](https://itsfoss.com/checksum-tools-guide-linux/) should help.

When using Collision, you just add the file that you need to generate a hash value or verify it. It only takes a few clicks to protect yourself against malicious or tampered files.

While I show a text file in the screenshot, you can verify any type of file or generate a hash for your files before sending it to someone else. You can share the hash values generated with the recipient to let them validate your file.

![collision hash values](https://itsfoss.com/content/images/wordpress/2022/04/collision-hash-values.png)

It is a straightforward open-source app that just lets you do two things:

- Generate Hash values (SHA-1, MD5, SHA-256, SHA-516)
- Verify an item against a checksum or by directly using the file

## Here’s How Collision App Works

To give you an example, I modified the original text file by adding a character to it and then tried verifying it.

Here’s what it looks like:

First, you need to open the original file that you want to compare it with or have the checksum value with you.

Open the original file first to generate the hash, and then head to the verify section to access a modified file.

![collision file open](https://itsfoss.com/content/images/wordpress/2022/04/collision-file-open.png)

You will notice that it detects that it isn’t the same:

![collision file check](https://itsfoss.com/content/images/wordpress/2022/04/collision-file-check.png)

In case you are checking against the checksum, first, open the file that you want to verify (here, we have the modified file).

![collision file verify](https://itsfoss.com/content/images/wordpress/2022/04/collision-file-verify.png)

And, then input the original checksum of the file. As we already know that we are testing a modified file, the result is what we expect, i.e., **failed to verify integrity**.

![collision input checksum](https://itsfoss.com/content/images/wordpress/2022/04/collision-input-checksum.png)

## Install Collision in Linux

Collision is primarily a GNOME-tailored app, but it works on any other distribution.

You can install it using the [Flatpak package available](https://flathub.org/apps/details/dev.geopjr.Collision), or build it from the source while exploring its GitHub page. You can refer to our [Flatpak guide](https://itsfoss.com/flatpak-guide/) for help if you’re new to Linux.

If you prefer using the terminal, type in the following to install it:

`flatpak install flathub dev.geopjr.Collision`


To get started, you can also visit its official website.