• /bin/crypt command on OS X?

    From 2me@2me@PaulComputing.com (Paul Nevai) to comp.sys.mac.system on Sunday, April 09, 2006 23:43:21
    From Newsgroup: comp.sys.mac.system

    Is there a command line equivalent of /bin/crypt on OS X? Thanks, PaulN
    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Michael Vilain@vilain@spamcop.net to comp.sys.mac.system on Sunday, April 09, 2006 19:02:08
    From Newsgroup: comp.sys.mac.system

    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.

    --
    DeeDee, don't press that button! DeeDee! NO! Dee...



    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Dave Seaman@dseaman@no.such.host to comp.sys.mac.system on Monday, April 10, 2006 02:12:37
    From Newsgroup: comp.sys.mac.system

    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.



    --
    Dave Seaman
    U.S. Court of Appeals to review three issues
    concerning case of Mumia Abu-Jamal.
    <http://www.mumia2000.org/>
    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Stephen Adams@adamst@no.spam to comp.sys.mac.system on Monday, April 10, 2006 02:18:36
    From Newsgroup: comp.sys.mac.system

    2me@PaulComputing.com (Paul Nevai) writes:

    Is there a command line equivalent of /bin/crypt on OS X? Thanks, PaulN

    Have you tried this:

    http://www.versiontracker.com/dyn/moreinfo/macosx/18586

    -Stephen
    --
    Space Age Cybernomad Stephen Adams
    malchus842SP@AMgmail.com (remove SPAM to reply)
    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From russotto@russotto@grace.speakeasy.net (Matthew Russotto) to comp.sys.mac.system on Sunday, April 09, 2006 22:10:04
    From Newsgroup: comp.sys.mac.system

    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.
    --
    There's no such thing as a free lunch, but certain accounting practices can
    result in a fully-depreciated one.
    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Paul Sture@paul.sture.nospam@hispeed.ch to comp.sys.mac.system on Monday, April 10, 2006 08:41:27
    From Newsgroup: comp.sys.mac.system

    Matthew Russotto wrote:
    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.

    LOL!
    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From nevai@nevai@math.ohio-state.edu (Paul Nevai) to comp.sys.mac.system on Monday, April 10, 2006 11:16:25
    From Newsgroup: comp.sys.mac.system

    Stephen Adams <adamst@no.spam> aszonygya: :http://www.versiontracker.com/dyn/moreinfo/macosx/18586

    Thank you, Stephen. /PaulN
    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Tom Harrington@tph@pcisys.no.spam.dammit.net to comp.sys.mac.system on Monday, April 10, 2006 10:09:51
    From Newsgroup: comp.sys.mac.system

    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

    --
    Tom "Tom" Harrington
    Macaroni, Automated System Maintenance for Mac OS X.
    Version 2.0: Delocalize, Repair Permissions, lots more.
    See http://www.atomicbird.com/
    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Michael Vilain@vilain@spamcop.net to comp.sys.mac.system on Monday, April 10, 2006 10:28:33
    From Newsgroup: comp.sys.mac.system

    In article <tph-8FB3BF.10095110042006@localhost>,
    Tom Harrington <tph@pcisys.no.spam.dammit.net> 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

    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

    Which of the these is the UNIX crypt function used for the old passwd
    file entries?

    --
    DeeDee, don't press that button! DeeDee! NO! Dee...



    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Ian Gregory@foo@bar.invalid to comp.sys.mac.system on Monday, April 10, 2006 18:10:57
    From Newsgroup: comp.sys.mac.system

    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

    --
    Ian Gregory
    http://www.zenatode.org.uk/ian/
    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Dave Seaman@dseaman@no.such.host to comp.sys.mac.system on Monday, April 10, 2006 20:35:58
    From Newsgroup: comp.sys.mac.system

    On 10 Apr 2006 18:10:57 GMT, Ian Gregory wrote:
    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

    Or, read the man page for crypt(3), and notice that my earlier suggestion
    to provide a C wrapper or use the perl version does exactly what you
    want.



    --
    Dave Seaman
    U.S. Court of Appeals to review three issues
    concerning case of Mumia Abu-Jamal.
    <http://www.mumia2000.org/>
    --- Synchronet 3.18b-Win32 NewsLink 1.113