DES_CRYPT


HOME

DES_CRYPT

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
VERSIONS
ATTRIBUTES
CONFORMING TO
SEE ALSO
COLOPHON

NAME

des_crypt, ecb_crypt, cbc_crypt, des_setparity, DES_FAILED − fast DES encryption

SYNOPSIS

#include <rpc/des_crypt.h>

int ecb_crypt(char *key, char *data, unsigned datalen,
unsigned
mode);

int cbc_crypt(char *key, char *data, unsigned datalen,
unsigned
mode, char *ivec);

void des_setparity(char *key);

int DES_FAILED(int status);

DESCRIPTION

ecb_crypt() and cbc_crypt() implement the NBS DES (Data Encryption Standard). These routines are faster and more general purpose than crypt(3). They also are able to utilize DES hardware if it is available. ecb_crypt() encrypts in ECB (Electronic Code Book) mode, which encrypts blocks of data independently. cbc_crypt() encrypts in CBC (Cipher Block Chaining) mode, which chains together successive blocks. CBC mode protects against insertions, deletions and substitutions of blocks. Also, regularities in the clear text will not appear in the cipher text.

Here is how to use these routines. The first argument, key, is the 8-byte encryption key with parity. To set the key’s parity, which for DES is in the low bit of each byte, use des_setparity(). The second argument, data, contains the data to be encrypted or decrypted. The third argument, datalen, is the length in bytes of data, which must be a multiple of 8. The fourth argument, mode, is formed by ORing together some things. For the encryption direction OR in either DES_ENCRYPT or DES_DECRYPT. For software versus hardware encryption, OR in either DES_HW or DES_SW. If DES_HW is specified, and there is no hardware, then the encryption is performed in software and the routine returns DESERR_NOHWDEVICE. For cbc_crypt(), the argument ivec is the 8-byte initialization vector for the chaining. It is updated to the next initialization vector upon return.

RETURN VALUE

DESERR_NONE

No error.

DESERR_NOHWDEVICE

Encryption succeeded, but done in software instead of the requested hardware.

DESERR_HWERROR

An error occurred in the hardware or driver.

DESERR_BADPARAM

Bad argument to routine.

Given a result status stat, the macro DES_FAILED(stat) is false only for the first two statuses.

VERSIONS

These routines are present in libc 4.6.27 and later, and in glibc 2.1 and later.

ATTRIBUTES

Multithreading (see pthreads(7))
The ecb_crypt(), cbc_crypt(), and des_setparity() functions are thread-safe.

CONFORMING TO

4.3BSD. Not in POSIX.1-2001.

SEE ALSO

des(1), crypt(3), xcrypt(3)

COLOPHON

This page is part of release 3.69 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at http://www.kernel.org/doc/man−pages/.




More Linux Commands

manpages/cnfsstat.8.html
cnfsstat(8) - Show usage of CNFS buffers - Linux man page...
cnfsstat reads pathetc/cycbuff.conf and pathetc/storage.conf to determine which CNFS buffers are available. It then reads the specified cyclic buffers and shows

manpages/cnf.1.html
cnf(1) - A command-not-found handler - Linux manual page....
command-not-found handler is designed to tell users which package contains a missing command. The handler is integrated to bash(1) and zsh(1) shells and is not

manpages/sis.4.html
sis(4) - SiS and XGI video driver - Linux manual page.......
sis is an Xorg driver for SiS (Silicon Integrated Systems) and XGI video chips. The driver is accelerated and provides support for colordepths of 8, 16 and 24 b

manpages/pamchannel.1.html
pamchannel(1) - extract channels from a PAM image (ManPage)
This program is part of Netpbm(1) pamchannel reads a Netpbm image as input and produces a PAM image as output, consisting of the indicated channels (planes) of

manpages/iso_8859-6.7.html
iso_8859-6(7) - ISO 8859-6 character set encoded in octal, d
The ISO 8859 standard includes several 8-bit extensions to the ASCII character set (also known as ISO 646-IRV). ISO 8859-6 encodes the characters used in the Ar

manpages/ndiswrapper.8.html
ndiswrapper(8) Linux kernel module and user space tool to lo
ndiswrapper is two parts: user space tool that is used to install Windows XP drivers and kernel module to load the Windows XP drivers. Both are called ndiswrapp

manpages/mvadd_wch.3ncurses.html
mvadd_wch(3ncurses) - add a complex character and rendition
The add_wch, wadd_wch, mvadd_wch, and mvwadd_wch functions put the complex character wch into the given window at its current position, which is then advanced.

manpages/vid_puts.3ncurses.html
vid_puts(3ncurses) - curses interfaces to terminfo database
These low-level routines must be called by programs that have to deal directly with the terminfo database to handle certain terminal capabilities, such as progr

manpages/SDL_SetAlpha.3.html
SDL_SetAlpha(3) - Adjust the alpha properties of a surface
Note: This function and the semantics of SDL alpha blending have changed since version 1.1.4. Up until version 1.1.5, an alpha value of 0 was considered opaque

manpages/XScreenSaverQueryInfo.3.html
XScreenSaverQueryInfo(3) - X11 Screen Saver extension client
The X Window System provides support for changing the image on a display screen after a user-settable period of inactivity to avoid burning the cathode ray tube

manpages/Xutf8ResetIC.3.html
Xutf8ResetIC(3) - reset the state of an input context.......
When XNResetState is set to XIMInitialState, XmbResetIC, XwcResetIC and Xutf8ResetIC reset an input context to its initial state; when XNResetState is set to XI

manpages/nonl.3ncurses.html
nonl(3ncurses) - curses output options - Linux manual page
These routines set options that change the style of output within curses. All options are initially FALSE, unless otherwise stated. It is not necessary to turn





We can't live, work or learn in freedom unless the software we use is free.