diff options
author | nsayer <nsayer@FreeBSD.org> | 1999-08-16 11:24:29 +0000 |
---|---|---|
committer | nsayer <nsayer@FreeBSD.org> | 1999-08-16 11:24:29 +0000 |
commit | 189690bcceec94a2b595d9e6d6beca23cd68b5cd (patch) | |
tree | 131b7d42306f643dcbd0094169238875d98500cf /crypto/telnet/libtelnet/pk.h | |
parent | 07419aec715eccc813e53ff53f4dd3dfe4c1298a (diff) | |
download | FreeBSD-src-189690bcceec94a2b595d9e6d6beca23cd68b5cd.zip FreeBSD-src-189690bcceec94a2b595d9e6d6beca23cd68b5cd.tar.gz |
Add SRA authentication to src/crypto/telnet.
SRA does a Diffie-Hellmen exchange and then DES-encrypts the
authentication data. If the authentication is successful, it also
sets up a session key for DES encryption.
SRA was originally developed at Texas A&M University.
This code is probably export restricted (despite the fact that I
originally found it at a University in Germany).
SRA is not perfect. It is vulnerable to monkey-in-the-middle attacks
and does not use tremendously large DH constants (and thus an individual
exchange probably could be factored in a few days on modern CPU
horsepower). It does not, however, require any changes in user or
administrative behavior and foils session hijacking and sniffing.
The goal of this commit is that telnet and telnetd end up in the DES
distribution and that therefore an encrypted session telnet becomes
standard issue for FreeBSD.
Diffstat (limited to 'crypto/telnet/libtelnet/pk.h')
-rw-r--r-- | crypto/telnet/libtelnet/pk.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/crypto/telnet/libtelnet/pk.h b/crypto/telnet/libtelnet/pk.h new file mode 100644 index 0000000..b41bba5 --- /dev/null +++ b/crypto/telnet/libtelnet/pk.h @@ -0,0 +1,41 @@ +/* header for the des routines that we will use */ + +typedef unsigned char byte, DesData[ 8], IdeaData[16]; +#if 0 +typedef unsigned long word, DesKeys[32]; +#else +#define DesKeys des_key_schedule +#endif + +#define DES_DECRYPT 0 +#define DES_ENCRYPT 1 + +#if 0 +extern void des_fixup_key_parity(); /* (DesData *key) */ +extern int des_key_sched(); /* (DesData *key, DesKeys *m) */ +extern int des_ecb_encrypt(); /* (DesData *src, *dst, DesKeys *m, int mode) */ +extern int des_cbc_encrypt(); /* (char *src, *dst, int length, + DesKeys *m, DesData *init, int mode) */ +#endif + +/* public key routines */ +/* functions: + genkeys(char *public, char *secret) + common_key(char *secret, char *public, desData *deskey) + where + char public[HEXKEYBYTES + 1]; + char secret[HEXKEYBYTES + 1]; + */ + +#define HEXMODULUS "d4a0ba0250b6fd2ec626e7efd637df76c716e22d0944b88b" +#define HEXKEYBYTES 48 +#define KEYSIZE 192 +#define KEYBYTES 24 +#define PROOT 3 + +extern void genkeys(char *public, char *secret); +extern void common_key(char *secret, char *public, IdeaData *common, + DesData *deskey); +extern void pk_encode(char *in, char *out, DesData *deskey); +extern void pk_decode(char *in, char *out, DesData *deskey); + |