macOS - md5 | md5sum

这篇具有很好参考价值的文章主要介绍了macOS - md5 | md5sum。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。


大文件传输是否完整,你可以使用 md5 进行校验
linux 上使用 md5sum 命令,在macOS 上 md5 命令是和 md5sum 等效的


简单使用介绍

参考:https://blog.csdn.net/cnds123321/article/details/124946370


Linux

# 字符串
$ echo "hello" |  md5sum
b1946ac92492d2347c6235b4d2611184  -

# 文件
$ md5sum a.txt
177dcfd6909426793115fec5397724ac  a.txt

macOS

$ echo "hello" | md5
b1946ac92492d2347c6235b4d2611184

$ md5 a.txt
MD5 (a.txt) = 0a61ff81d3ed58dc1828b17e46fcbd9c

文档

Linux - md5sum

md5sum --help

Usage:

md5sum [OPTION]… [FILE]…

Print or check MD5 (128-bit) checksums.
With no FILE, or when FILE is -, read standard input.

  • -b, –binary`, read in binary mode
  • -c, –check`, read MD5 sums from the FILEs and check them
  • --tag, create a BSD-style checksum
  • -t, –text`, read in text mode (default)

Note: There is no difference between binary and text mode option on GNU system.


The following four options are useful only when verifying checksums:

  • --quiet, don’t print OK for each successfully verified file
  • --status, don’t output anything, status code shows success
  • --strict, exit non-zero for improperly formatted checksum lines
  • -w, --warn, warn about improperly formatted checksum lines
  • --help, display this help and exit
  • --version, output version information and exit

The sums are computed as described in RFC 1321. When checking, the input
should be a former output of this program. The default mode is to print
a line with checksum, a character indicating input mode (‘*’ for binary,
space for text), and name for each FILE.

GNU coreutils online help: http://www.gnu.org/software/coreutils/
For complete documentation, run: info coreutils ‘md5sum invocation’


macOS - md5

man md5

NAME
md5 – calculate a message-digest fingerprint (checksum) for a file

SYNOPSIS

md5 [-pqrtx] [-s string] [file …]

DESCRIPTION
The md5 utility takes as input a message of arbitrary length and produces as output a “fingerprint” or “message digest” of the input.
It is conjectured that it is computationally infeasible to produce two messages having the same message digest, or to produce any message having a given prespecified target message digest.
The MD5 algorithm is intended for digital signature applications, where a large file must be “compressed” in a secure manner before being encrypted with a private (secret) key under a public-key cryptosystem such as RSA.

MD5’s designer Ron Rivest has stated “md5 and sha1 are both clearly broken (in terms of collision-resistance)”.
So MD5 should be avoided when creating new protocols, or implementing protocols with better options. SHA256 and SHA512 are better options as they have been more resilient to attacks (as of 2009).

The following options may be used in any combination and must precede any files named on the command line.
The hexadecimal checksum of each file listed on the command line is printed after the options are processed.

  • -s string, Print a checksum of the given string.
  • -p, Echo stdin to stdout and append the checksum to stdout.
  • -q, Quiet mode - only the checksum is printed out. Overrides the -r option.
  • -r, Reverses the format of the output. This helps with visual diffs. Does nothing when combined with the -ptx options.
  • -t, Run a built-in time trial.
  • -x, Run a built-in test script.

EXIT STATUS
The md5 utility exits 0 on success, and 1 if at least one of the input files could not be read.

SEE ALSO
cksum(1), CC_SHA256_Init(3), md5(3), ripemd(3), sha(3)

R. Rivest, The MD5 Message-Digest Algorithm, RFC1321.

Vlastimil Klima, Finding MD5 Collisions - a Toy For a Notebook, Cryptology ePrint Archive: Report 2005/075.

ACKNOWLEDGMENTS
This program is placed in the public domain for free general use by RSA Data Security.


伊织 2024-01-17 (三)文章来源地址https://www.toymoban.com/news/detail-801347.html

到了这里,关于macOS - md5 | md5sum的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Linux shell编程学习笔记44:编写一个脚本,将md5sum命令执行结果保存到变量中,进而比较两个文件内容是否相同

    在  Linux shell编程学习笔记42:md5sum https://blog.csdn.net/Purpleendurer/article/details/137125672?spm=1001.2014.3001.5501 中,我们提到编写一个在Linux系统下比较两个文件内容是否相同的脚本。 基本思路是: 其中有两个难点: 1.文件的md5值的获取 2.md5值的比较 对于第1个难点,我们的解决办法是

    2024年04月10日
    浏览(51)
  • window,macOS,Linux计算文件MD5值,java实现例子

    打开命令行工具。在Windows系统中,可以使用\\\"cmd\\\"命令打开命令行窗口;在macOS或Linux系统中,可以使用\\\"Terminal\\\"打开终端。 进入文件所在的目录。使用\\\"cd\\\"命令进入文件所在的目录。 计算文件的MD5哈希值。在命令行中输入\\\"certutil -hashfile 文件名 MD5\\\"命令(Windows系统),或者输入

    2024年02月06日
    浏览(26)
  • 【MD5】什么是MD5?md5的简要描述

    MD5:英文全称是 Message-Digest Algorithm 5。 中文名为 消息摘要算法第五版。它是消息摘要算法,属于 Hash 算法的一种。 正常情况下,它的结果是一个 长度为 32位 的 16进制 的 字符串 。 也有一些地方会用到 16 位的 MD5的结果,它实际上是从 32位 字符串中取中间的第9位到第24位的

    2024年02月08日
    浏览(38)
  • PHP md5()函数详解,PHP计算MD5,md5()绕过,md5()漏洞原理剖析

    「作者主页」: 士别三日wyx 「作者简介」: CSDN top100、阿里云博客专家、华为云享专家、网络安全领域优质创作者 「推荐专栏」: 对网络安全感兴趣的小伙伴可以关注专栏《网络安全入门到精通》 md5() 可以计算字符串的 「MD5散列值」 。 语法 参数 $str :需要计算的字符串

    2024年02月06日
    浏览(32)
  • linux:md5命令以及md5的使用场景

    MD5广泛用于数据完整性校验和密码存储,它是一种不可逆的加密算法,目前无法解密。它会逐位对文件的内容进行校验。是文件的内容,与文件名无关,也就是文件内容相同,其md5值相同。 在数据完整性校验中,MD5可用于验证数据的完整性。例如,在下载文件后,可以对下载

    2024年02月06日
    浏览(31)
  • win中查看MD5、Linux中查看MD5

    Git Bash Here

    2024年02月04日
    浏览(29)
  • uniapp使用md5加密 js使用md5加密

    文章的初衷 最近项目中使用了md5加密,为了方便还不明白怎么使用的朋友参考查阅,当然也为了方便博主再次使用所写 md5加密说明 可在不同平台使用 因为使用方法是js方法去调用的所以不局限于某个平台 我这里使用的方式是登录的时候进行加密,具体其他的使用方式,朋友们自

    2024年02月07日
    浏览(55)
  • 使用md5collgen进行MD5碰撞实验

    题目1:可在ubuntu主机上预先安装md5collgen,题目为“生成两个MD5哈希值一致但是文件内容不同的文件”。 所谓“文件内容不同但却有相同的哈希值”就是 碰撞。 在这个题目中,我们将生成两个具有相同MD5哈希值的不同文件。这两个文件的开始部分需要相同,即它们共享相同

    2024年01月24日
    浏览(30)
  • MD5算法:利用python进行md5 hash值的获取

    MD5,即信息摘要算法,英文为MD5 Message-Digest Algorithm,是一种被广泛使用的密码散列函数,可以产生出一个128位(16字节)的散列值(hash value),也叫散列值,用于确保信息传输完整一致。 它可以从一个字符串或一个文件中按照一定的规则生成一个特殊的字符串,这个特殊的

    2024年02月07日
    浏览(29)
  • 为什么MD5算法不可逆,但网上有很多网站声称能够解密MD5

    我们要明白,MD5不是加密算法,而是一种信息摘要算法,主要用于保证数据的完整性,以及数据不被篡改。既然不是加密算法,那么就不存在解密的说法,但是为什么网上有很多网站声称能够解密MD5呢? MD5算法不可逆 Md5是计算机安全领取常用的一种密码散列函数,主要用于

    2024年02月11日
    浏览(39)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包