1digest(1) User Commands digest(1)
2
3
4
6 digest - calculate a message digest
7
9 /usr/bin/digest -l | [-v] -a algorithm [file]...
10
11
13 The digest utility calculates the message digest of the given files or
14 stdin using the algorithm specified. If more than one file is given,
15 each line of output is the digest of a single file.
16
18 The following options are supported:
19
20 -a algorithm Specifies the name of the algorithm to use during the
21 encryption or decryption process. See USAGE, Algo‐
22 rithms, for details.
23
24
25 -l Displays list of algorithms available on the system.
26 This list can change depending on the configuration of
27 the cryptographic framework.
28
29
30 -v Verbose output. Includes the algorithm name and file‐
31 name in the output.
32
33
35 Algorithms
36 These algorithms are provided by the Cryptographic Framework. Each
37 algorithm supported by the command is an alias of the PKCS #11 mecha‐
38 nism for easier access. For example, sha1 is an alias to CKM_SHA_1.
39
40
41 These aliases are used with the -a option and are case-sensitive.
42
44 Example 1 Simulating Output
45
46
47 The following example simulates output of the common md5sum program:
48
49
50 example$ digest -v -a md5 /usr/bin/vi
51 md5 (/usr/bin/vi) = e4e3588c5212903847c66d36b1a828a5
52
53
54
55 Example 2 Digesting a File
56
57
58 The following example generates the sha1 digest of the file /etc/motd:
59
60
61 example$ digest -a sha1 /etc/motd
62 9498a4f5303d056ad3ecae826b59f41448d63790
63
64
65
66 Example 3 Generating a Directory Manifest
67
68
69 The following example generates a directory manifest with sha1:
70
71
72 example$ digest -v -a sha1 /usr/lib/inet/*
73 sha1 (/usr/lib/inet/certdb) = f6d43e6e395d50db24d34e4af4828598c8918b16
74 sha1 (/usr/lib/inet/certlocal) = 7f74ba4a019b809c7023212b4bda10d9485e071d
75 sha1 (/usr/lib/inet/certrldb) = 1f845d30b8d02066647de04311e74549049852ed
76 sha1 (/usr/lib/inet/dhcp) = e3db5e4ff40a69d13f2497254526c2015d2c37b3
77 sha1 (/usr/lib/inet/dsvclockd) = b61aad7ed6a0f82145c3c26aedc613ab4a1f032e
78 sha1 (/usr/lib/inet/in.dhcpd) = 382210180c826fbb2e747236c489062bac8cc30b
79 sha1 (/usr/lib/inet/in.iked) = be6061fad725d37256e773dc85f8bd5248649463
80 sha1 (/usr/lib/inet/in.mpathd) = 5bd6bf0340fd5c4cc0c53f2df158302a0e85f9d0
81 sha1 (/usr/lib/inet/in.ndpd) = fdb768aebe7e5eb4465e1c1bb5e679b496f5c5c6
82 sha1 (/usr/lib/inet/in.ripngd) = 4f56a0df2d4a252f581a73c2e84143b920d0b66b
83 sha1 (/usr/lib/inet/ncaconfd) = 7219542b5585a8d1104d7ce4a2ced07d8a260ea3
84 sha1 (/usr/lib/inet/ppp) = c96ee458549871a6ffdf2674a888b01d0c9e9740
85 sha1 (/usr/lib/inet/pppoec) = 5f022498d79dacacd947cddadc64f171822e3dee
86 sha1 (/usr/lib/inet/pppoed) = 252bd2f0863dbc1b05fffae72821a2a95609b8ad
87 sha1 (/usr/lib/inet/slpd) = dfa24cc0f0b05f790546d4f0948a9094f7089027
88 sha1 (/usr/lib/inet/wanboot) = a8b8c51c389c774d0be2ae43cb85d1b1439484ae
89 sha1 (/usr/lib/inet/ntpd) = 5b4aff102372cea801e7d08acde9655fec81f07c
90
91
92
93 Example 4 Displaying a List of Available Algorithms
94
95
96 The following example displays a list of available algortithms to
97 digest:
98
99
100 example$ digest -l
101 sha1
102 md5
103 sha256
104 sha385
105 sha512
106
107
108
110 The following exit values are returned:
111
112 0 Successful completion.
113
114
115 >0 An error occurred.
116
117
119 See attributes(5) for descriptions of the following attributes:
120
121
122
123
124 ┌─────────────────────────────┬─────────────────────────────┐
125 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
126 ├─────────────────────────────┼─────────────────────────────┤
127 │Availability │SUNWcsu │
128 ├─────────────────────────────┼─────────────────────────────┤
129 │Interface Stability │Committed │
130 └─────────────────────────────┴─────────────────────────────┘
131
133 cksum(1), encrypt(1), mac(1), bart(1M), cryptoadm(1M), libpkcs11(3LIB),
134 attributes(5), pkcs11_softtoken(5)
135
136
137
138SunOS 5.11 21 May 2009 digest(1)