aboutsummaryrefslogtreecommitdiffstats
path: root/doc/python.tex
blob: afdd66b6ab671b1298e5a3f4089397dda679c113 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
\documentclass{article}

\setlength{\textwidth}{6.5in} % 1 inch side margins
\setlength{\textheight}{9in} % ~1 inch top and bottom margins

\setlength{\headheight}{0in}
\setlength{\topmargin}{0in}
\setlength{\headsep}{0in}

\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{0in}

\title{\textbf{Botan Python Interface Documentation}}
\author{Jack Lloyd \\
        \texttt{lloyd@randombit.net}}
\date{2009/10/10}

\newcommand{\filename}[1]{\texttt{#1}}
\newcommand{\manpage}[2]{\texttt{#1}(#2)}

\newcommand{\macro}[1]{\texttt{#1}}

\newcommand{\function}[1]{\textbf{#1}}
\newcommand{\type}[1]{\texttt{#1}}
\renewcommand{\arg}[1]{\textsl{#1}}
\newcommand{\variable}[1]{\textsl{#1}}

\begin{document}

\maketitle

\tableofcontents

\parskip=5pt
\pagebreak

\section{Ciphers}

Botan's Python interface provides a generic interface to any cipher
supported by the library. The class \type{botan.Cipher} takes three
arguments, all strings: first, the name of the algorith, second the
direction (which can be either ``encrypt'' or ``decrypt''), and
lastly, the key to use. For instance

\begin{verbatim}
    encryptor = botan.Cipher("AES-128/EAX", "encrypt", key)
\end{verbatim}

creates an object that will encrypt and authenticate messages using
the EAX mode of operation using the AES cipher. To use this object,
call the \function{cipher} function with two arguments - the input
to encrypt, and the IV to use:

\begin{verbatim}
    ciphertext = encryptor.cipher(input, salt)
\end{verbatim}


\subsection{Cryptobox}


\subsection{RNGs}

\section{RSA}



\end{document}