macOS - md5 | md5sum

文章目录


大文件传输是否完整,你可以使用 md5 进行校验

linux 上使用 md5sum 命令,在macOS 上 md5 命令是和 md5sum 等效的


简单使用介绍

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


Linux

shell 复制代码
# 字符串
$ echo "hello" |  md5sum
b1946ac92492d2347c6235b4d2611184  -

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

macOS

shell 复制代码
$ echo "hello" | md5
b1946ac92492d2347c6235b4d2611184

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

文档

Linux - md5sum

shell 复制代码
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

shell 复制代码
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 (三)

相关推荐
zhujiahui62218 分钟前
Mac M1安装配置Hadoop+Flink SQL环境
大数据·macos·flink·flink sql
志远有18CM1 小时前
MacOS 通过Docker安装宝塔面板搭建PHP开发环境
macos·docker·php·宝塔
YoungGeeker1 小时前
ChatGPT Mac App 发布!
人工智能·macos·chatgpt
草明2 小时前
macOS 的电源适配器设置
macos
Eloudy2 小时前
Macos 远程登录 Ubuntu22.04 桌面
macos·tightvnc
bigbig猩猩11 小时前
IOS热门面试题二
macos·ios·cocoa
默默的偷学者12 小时前
uniapp mac m1 arm芯片编译问题
macos·uni-app
顶顶年华正版软件官方13 小时前
苹果电脑压缩软件哪个好用一些? mac电脑用什么压缩软件 mac电脑压缩文件怎么设置密码
macos·电脑·betterzip·压缩软件·苹果电脑解压缩·归档实用工具
2401_8552992113 小时前
macbook触控栏养宠物:Touchbar pet for Mac 免费下载
macos·宠物
hanruanjian20 小时前
FLStudio21.3.12中文破解版本安装包win+mac电脑安装包下载
android·运维·数据库·macos·编辑器