3 encrypt, decrypt, netcrypt \- DES encryption
10 int encrypt(void *key, void *data, int len)
13 int decrypt(void *key, void *data, int len)
16 int netcrypt(void *key, void *data)
21 perform DES encryption and decryption.
27 bytes containing the encryption key.
32 it must be at least 8 bytes long.
33 The bytes are encrypted or decrypted in place.
35 The DES algorithm encrypts an individual 8-byte block of data.
37 uses the following method to encrypt data longer than 8 bytes.
38 The first 8 bytes are encrypted as usual.
39 The last byte of the encrypted result
40 is prefixed to the next 7 unencrypted bytes to make the next 8
42 This is repeated until fewer than 7 bytes remain unencrypted.
43 Any remaining unencrypted bytes are encrypted with enough of the preceding
44 encrypted bytes to make a full 8-byte block.
46 uses the inverse algorithm.
49 performs the same encryption as a SecureNet Key.
53 string of decimal digits with numeric value between 0 and 10000.
54 These digits are copied into an 8-byte buffer with trailing binary zero fill
55 and encrypted as one DES block.
56 The first four bytes are each formatted as two digit
59 and the string is copied into
62 .B /usr/local/plan9/src/libc/port
64 These routines return 1 if the data was encrypted,
65 and 0 if the encryption fails.
69 fail if the data passed is less than 8 bytes long.
71 can fail if it is passed invalid data.
75 The implementation is broken in a way that makes
76 it unsuitable for anything but authentication.