blob: 20d43f6627fdf767f448a0b7c1cabfc87cd2df00 [file] [log] [blame]
rsccfa37a72004-04-10 18:53:55 +00001.TH BLOWFISH 3
2.SH NAME
3setupBFstate, bfCBCencrypt, bfCBCdecrypt, bfECBencrypt, bfECBdecrypt - blowfish encryption
4.SH SYNOPSIS
5.B #include <u.h>
6.br
7.B #include <libc.h>
8.br
9.B #include <mp.h>
10.br
11.B #include <libsec.h>
12.PP
13.B
14void setupBFstate(BFstate *s, uchar key[], int keybytes,
15.B
16 uchar *ivec)
17.PP
18.B
19void bfCBCencrypt(uchar *data, int len, BFstate *s)
20.PP
21.B
22void bfCBCdecrypt(uchar *data, int len, BFstate *s)
23.PP
24.B
25void bfECBencrypt(uchar *data, int len, BFstate *s)
26.PP
27.B
28void bfECBdecrypt(uchar *data, int len, BFstate *s)
29.SH DESCRIPTION
30.PP
31Blowfish is Bruce Schneier's symmetric block cipher. It supports
32variable length keys from 32 to 448 bits and has a block size of 64
33bits. Both CBC and ECB modes are supported.
34.PP
35setupBFstate takes a BFstate structure, a key of at most 56 bytes, the
36length of the key in bytes, and an initialization vector of 8 bytes
37(set to all zeroes if argument is nil). The encryption and decryption
38functions take a BFstate structure, a data buffer, and a length, which
39must be a multiple of eight bytes as padding is currently unsupported.
40.SH SOURCE
rscc3674de2005-01-11 17:37:33 +000041.B \*9/src/libsec
rsccfa37a72004-04-10 18:53:55 +000042.SH SEE ALSO
rscbf8a59f2004-04-11 03:42:27 +000043.IR mp (3),
44.IR aes (3),
45.IR des (3),
46.IR dsa (3),
47.IR elgamal (3),
48.IR rc4 (3),
49.IR rsa (3),
50.IR sechash (3),
51.IR prime (3),
52.IR rand (3)