Is there a command line equivalent of /bin/crypt on OS X? Thanks, PaulN
In article <e1c66p$2c8$1@charm.magnus.acs.ohio-state.edu>,
2me@PaulComputing.com (Paul Nevai) wrote:
Is there a command line equivalent of /bin/crypt on OS X? Thanks, PaulN
I'm guessing here, but in order to include this in the OS, Apple would
have to comply with various export restrictions. Rather than doing
that, they didn't include it. You'll most likely have to obtain the
code from another OS, compile it, and install it yourself. Google for
it.
Is there a command line equivalent of /bin/crypt on OS X? Thanks, PaulN
On Sun, 09 Apr 2006 19:02:08 -0700, Michael Vilain wrote:
In article <e1c66p$2c8$1@charm.magnus.acs.ohio-state.edu>,
2me@PaulComputing.com (Paul Nevai) wrote:
Is there a command line equivalent of /bin/crypt on OS X? Thanks, PaulN
I'm guessing here, but in order to include this in the OS, Apple would
have to comply with various export restrictions. Rather than doing
that, they didn't include it. You'll most likely have to obtain the
code from another OS, compile it, and install it yourself. Google for
it.
I don't follow that, since crypt(3) is included and it's trivial to write
a C wrapper for it. It's also available in perl.
In article <e1ceul$mi2$1@mailhub227.itcs.purdue.edu>,
Dave Seaman <dseaman@no.such.host> wrote:
On Sun, 09 Apr 2006 19:02:08 -0700, Michael Vilain wrote:
In article <e1c66p$2c8$1@charm.magnus.acs.ohio-state.edu>,
2me@PaulComputing.com (Paul Nevai) wrote:
Is there a command line equivalent of /bin/crypt on OS X? Thanks, PaulN
I'm guessing here, but in order to include this in the OS, Apple would >>>have to comply with various export restrictions. Rather than doing >>>that, they didn't include it. You'll most likely have to obtain the >>>code from another OS, compile it, and install it yourself. Google for >>>it.
I don't follow that, since crypt(3) is included and it's trivial to write
a C wrapper for it. It's also available in perl.
The command-line crypt I know of wasn't related to crypt(3); it uses a
cipher related to Enigma.
I don't think export restrictions had anything to do with it not being included; the Axis already has it, after all.
Is there a command line equivalent of /bin/crypt on OS X? Thanks, PaulN
In article <e1c66p$2c8$1@charm.magnus.acs.ohio-state.edu>,
2me@PaulComputing.com (Paul Nevai) wrote:
Is there a command line equivalent of /bin/crypt on OS X? Thanks, PaulN
There's /usr/bin/openssl, which will encrypt/decrypt with any of a
variety of algorithms.
In general, to encrypt a file, you use something like this:
openssl enc -e -bf -in filename-original -out filename-encrypted
The "bf" here refers to bluefish encoding-- you'd change that for a different algorithm. To decrypt, change the "-e" to "-d".
The list of included ciphers includes:
-aes-128-cbc -aes-128-cfb -aes-128-cfb1 -aes-128-cfb8 -aes-128-ecb -aes-128-ofb -aes-192-cbc -aes-192-cfb -aes-192-cfb1 -aes-192-cfb8 -aes-192-ecb -aes-192-ofb -aes-256-cbc -aes-256-cfb -aes-256-cfb1 -aes-256-cfb8 -aes-256-ecb -aes-256-ofb
-aes128 -aes192 -aes256
-bf -bf-cbc -bf-cfb
-bf-ecb -bf-ofb -blowfish
-cast -cast-cbc -cast5-cbc
-cast5-cfb -cast5-ecb -cast5-ofb
-des -des-cbc -des-cfb
-des-cfb1 -des-cfb8 -des-ecb
-des-ede -des-ede-cbc -des-ede-cfb -des-ede-ofb -des-ede3 -des-ede3-cbc -des-ede3-cfb -des-ede3-ofb -des-ofb
-des3 -desx -desx-cbc
-rc2 -rc2-40-cbc -rc2-64-cbc
-rc2-cbc -rc2-cfb -rc2-ecb
-rc2-ofb -rc4 -rc4-40
-rc5 -rc5-cbc -rc5-cfb
-rc5-ecb -rc5-ofb
In article <tph-8FB3BF.10095110042006@localhost>,
The list of included ciphers includes:
Which of the these is the UNIX crypt function used for the old passwd
file entries?
On 2006-04-10, Michael Vilain <vilain@spamcop.net> wrote:
In article <tph-8FB3BF.10095110042006@localhost>,
The list of included ciphers includes:
[list snipped]
Which of the these is the UNIX crypt function used for the old passwd
file entries?
None of the above:-) But I have worked out how to do traditional
Unix crypt on the command line using Mac OS X (10.3.9).
As you may know, only the first 8 characters of a traditional Unix
password are used. The encryption is done using a randomly chosen
two character "salt" which then appears as the first two characters
of the encrypted password. To do the encryption on the command line
you first have to choose (or randomly generate) your salt - let's
choose "SA". Now choose an unencrypted password with a maximum of
eight characters, I will give an example with less than eight as
that requires an additional step - let's choose "sjobs". Now we
are ready to encrypt it with /usr/libexec/makekey. The tricky bit
is padding the unencrypted password to eight characters with nulls -
I do it using tr(1). So here is the command line:
echo "sjobs***SA" | tr '*' '\000' | /usr/libexec/makekey > crypt
The file "crypt" now contains the encrypted password.
Ian
Sysop: | Gate Keeper |
---|---|
Location: | Shelby, NC |
Users: | 790 |
Nodes: | 20 (0 / 20) |
Uptime: | 39:01:21 |
Calls: | 12,115 |
Calls today: | 5 |
Files: | 5,294 |
D/L today: |
72 files (9,959K bytes) |
Messages: | 564,922 |