encrypt.c File Reference
#include "squid.h"
#include <time.h>
#include <string.h>
#include <stdlib.h>
Include dependency graph for encrypt.c:

Go to the source code of this file.

Macros

#define BS   64
 
#define BS2   32
 
#define KS   48
 
#define KS2   24
 
#define IS   56
 
#define IS2   28
 

Functions

static void perm (char *a, char *e, char *pc, int n)
 
static void crypt_main (char *nachr_l, char *nachr_r, char *schl)
 
void encrypt (char *nachr, int decr)
 
void setkey (char *schl)
 
char * crypt (const char *wort, const char *salt)
 

Variables

static char schluessel [16][KS]
 
static char PC1 []
 
static char PC2 []
 
static char IP []
 
static char EP []
 
static char E0 []
 
static char E [KS]
 
static char PERM []
 
static char S_BOX [][64]
 

Macro Definition Documentation

◆ BS

#define BS   64

Definition at line 32 of file encrypt.c.

◆ BS2

#define BS2   32

Definition at line 33 of file encrypt.c.

◆ IS

#define IS   56

Definition at line 36 of file encrypt.c.

◆ IS2

#define IS2   28

Definition at line 37 of file encrypt.c.

◆ KS

#define KS   48

Definition at line 34 of file encrypt.c.

◆ KS2

#define KS2   24

Definition at line 35 of file encrypt.c.

Function Documentation

◆ crypt()

char * crypt ( const char *  wort,
const char *  salt 
)

Definition at line 240 of file encrypt.c.

References BS, E, encrypt(), and setkey().

Referenced by main(), and passwd_auth().

◆ crypt_main()

static void crypt_main ( char *  nachr_l,
char *  nachr_r,
char *  schl 
)
static

Definition at line 163 of file encrypt.c.

References BS2, E, int, KS, PERM, and S_BOX.

Referenced by encrypt().

◆ encrypt()

void encrypt ( char *  nachr,
int  decr 
)

Definition at line 188 of file encrypt.c.

References BS, BS2, crypt_main(), EP, IP, KS, perm(), and schluessel.

Referenced by crypt(), internalRemoteUri(), and Adaptation::ServiceConfig::parse().

◆ perm()

static void perm ( char *  a,
char *  e,
char *  pc,
int  n 
)
static

Definition at line 153 of file encrypt.c.

Referenced by encrypt(), and setkey().

◆ setkey()

void setkey ( char *  schl)

Definition at line 213 of file encrypt.c.

References E, E0, IS, IS2, KS, PC1, PC2, perm(), and schluessel.

Referenced by crypt().

Variable Documentation

◆ E

char E[KS]
static

Definition at line 92 of file encrypt.c.

Referenced by EventScheduler::cancel(), crypt(), crypt_main(), EventScheduler::schedule(), and setkey().

◆ E0

char E0[]
static
Initial value:
= {
31, 0, 1, 2, 3, 4, 3, 4,
5, 6, 7, 8, 7, 8, 9, 10,
11, 12, 11, 12, 13, 14, 15, 16,
15, 16, 17, 18, 19, 20, 19, 20,
21, 22, 23, 24, 23, 24, 25, 26,
27, 28, 27, 28, 29, 30, 31, 0
}

Definition at line 83 of file encrypt.c.

Referenced by setkey().

◆ EP

char EP[]
static
Initial value:
= {
7, 39, 15, 47, 23, 55, 31, 63,
6, 38, 14, 46, 22, 54, 30, 62,
5, 37, 13, 45, 21, 53, 29, 61,
4, 36, 12, 44, 20, 52, 28, 60,
3, 35, 11, 43, 19, 51, 27, 59,
2, 34, 10, 42, 18, 50, 26, 58,
1, 33, 9, 41, 17, 49, 25, 57,
0, 32, 8, 40, 16, 48, 24, 56
}

Definition at line 72 of file encrypt.c.

Referenced by encrypt().

◆ IP

char IP[]
static
Initial value:
= {
57, 49, 41, 33, 25, 17, 9, 1,
59, 51, 43, 35, 27, 19, 11, 3,
61, 53, 45, 37, 29, 21, 13, 5,
63, 55, 47, 39, 31, 23, 15, 7,
56, 48, 40, 32, 24, 16, 8, 0,
58, 50, 42, 34, 26, 18, 10, 2,
60, 52, 44, 36, 28, 20, 12, 4,
62, 54, 46, 38, 30, 22, 14, 6
}

Definition at line 61 of file encrypt.c.

Referenced by encrypt().

◆ PC1

char PC1[]
static
Initial value:
= {
56, 48, 40, 32, 24, 16, 8, 0,
57, 49, 41, 33, 25, 17, 9, 1,
58, 50, 42, 34, 26, 18, 10, 2,
59, 51, 43, 35,
62, 54, 46, 38, 30, 22, 14, 6,
61, 53, 45, 37, 29, 21, 13, 5,
60, 52, 44, 36, 28, 20, 12, 4,
27, 19, 11, 3
}

Definition at line 41 of file encrypt.c.

Referenced by setkey().

◆ PC2

char PC2[]
static
Initial value:
= {
13, 16, 10, 23, 0, 4, 2, 27,
14, 5, 20, 9, 22, 18, 11, 3,
25, 7, 15, 6, 26, 19, 12, 1,
40, 51, 30, 36, 46, 54, 29, 39,
50, 44, 32, 47, 43, 48, 38, 55,
33, 52, 45, 41, 49, 35, 28, 31
}

Definition at line 52 of file encrypt.c.

Referenced by setkey().

◆ PERM

char PERM[]
static
Initial value:
= {
15, 6, 19, 20, 28, 11, 27, 16,
0, 14, 22, 25, 4, 17, 30, 9,
1, 7, 23, 13, 31, 26, 2, 8,
18, 12, 29, 5, 21, 10, 3, 24
}

Definition at line 94 of file encrypt.c.

Referenced by crypt_main().

◆ S_BOX

char S_BOX[][64]
static

Definition at line 101 of file encrypt.c.

Referenced by crypt_main().

◆ schluessel

char schluessel[16][KS]
static

Definition at line 39 of file encrypt.c.

Referenced by encrypt(), and setkey().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors