des_setkey man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

CIPHER(3)		 BSD Library Functions Manual		     CIPHER(3)

NAME
     setkey, encrypt, des_setkey, des_cipher — DES encryption

LIBRARY
     library “libcipher”

SYNOPSIS
     #include <unistd.h>

     int
     setkey(const char *key);

     int
     encrypt(char *block, int flag);

     int
     des_setkey(const char *key);

     int
     des_cipher(const char *in, char *out, long salt, int count);

DESCRIPTION
     The functions, encrypt(), setkey(), des_setkey() and des_cipher() provide
     access to the DES algorithm.  setkey() is passed a 64-byte array of
     binary values (numeric 0 or 1).  A 56-bit key is extracted from this
     array by dividing the array into groups of 8, and ignoring the last bit
     in each group.  That bit is reserved for a byte parity check by DES, but
     is ignored by these functions.

     The block argument to encrypt() is also a 64-byte array of binary values.
     If the value of flag is 0, block is encrypted otherwise it is decrypted.
     The result is returned in the original array block after using the key
     specified by setkey() to process it.

     The argument to des_setkey() is a character array of length 8.  The least
     significant bit (the parity bit) in each character is ignored, and the
     remaining bits are concatenated to form a 56-bit key.  The function
     des_cipher() encrypts (or decrypts if count is negative) the 64-bits
     stored in the 8 characters at in using abs(3) of count iterations of DES
     and stores the 64-bit result in the 8 characters at out (which may be the
     same as in).  The salt introduces disorder in the DES algorithm in one of
     16777216 or 4096 possible ways (ie. with 24 or 12 bits: if bit i of the
     salt is set, then bits i and i+24 are swapped in the DES E-box output).

     The functions setkey(), encrypt(), des_setkey(), and des_cipher() return
     0 on success and 1 on failure.

     The setkey() and des_setkey() functions manipulate the same key space.

SEE ALSO
     login(1), passwd(1), crypt(3), getpass(3), passwd(5)

HISTORY
     This library (FreeSec 1.0) was developed outside the United States of
     America as an unencumbered replacement for the U.S.-only NetBSD libcrypt
     encryption library.  Users should be aware that this code (and programs
     staticly linked with it) may not be exported from the U.S., although it
     apparently can be imported.

AUTHORS
     David Burren ⟨davidb@werj.com.au⟩

BSD				 March 9, 1994				   BSD
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net