FS2_Open
Open source remastering of the Freespace 2 engine
encrypt.cpp File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "globalincs/pstypes.h"
#include "parse/encrypt.h"

Go to the source code of this file.

Macros

#define ENCRYPT_NEW
 
#define NUM_LVL1_KEYS   11
 

Functions

void encrypt_new (char *text, int text_len, char *scrambled_text, int *scrambled_len)
 
void unencrypt_new (char *scrambled_text, int scrambled_len, char *text, int *text_len)
 
ushort chksum_add_short (ushort seed, char *buffer, int size)
 
void encrypt (char *text, int text_len, char *scrambled_text, int *scrambled_len, int use_8bit, bool new_encrypt)
 
void unencrypt (char *scrambled_text, int scrambled_len, char *text, int *text_len)
 
int is_encrypted (char *scrambled_text)
 
int is_old_encrypt (char *scrambled_text)
 
const char * encrypt_type (char *scrambled_text)
 
void encrypt_init ()
 

Variables

const uint Encrypt_new_signature = 0x551a335c
 
const uint Encrypt_signature = 0xefbeadde
 
const uint Encrypt_signature_8bit = 0xcacacaca
 
int Encrypt_inited = 0
 
ushort Lvl1_keys [NUM_LVL1_KEYS]
 

Macro Definition Documentation

#define ENCRYPT_NEW

Definition at line 16 of file encrypt.cpp.

#define NUM_LVL1_KEYS   11

Definition at line 294 of file encrypt.cpp.

Function Documentation

ushort chksum_add_short ( ushort  seed,
char *  buffer,
int  size 
)

Definition at line 39 of file encrypt.cpp.

void encrypt ( char *  text,
int  text_len,
char *  scrambled_text,
int scrambled_len,
int  use_8bit,
bool  new_encrypt 
)

Definition at line 64 of file encrypt.cpp.

void encrypt_init ( )

Definition at line 453 of file encrypt.cpp.

void encrypt_new ( char *  text,
int  text_len,
char *  scrambled_text,
int scrambled_len 
)

Definition at line 310 of file encrypt.cpp.

const char* encrypt_type ( char *  scrambled_text)

Definition at line 435 of file encrypt.cpp.

int is_encrypted ( char *  scrambled_text)

Definition at line 407 of file encrypt.cpp.

int is_old_encrypt ( char *  scrambled_text)

Definition at line 421 of file encrypt.cpp.

void unencrypt ( char *  scrambled_text,
int  scrambled_len,
char *  text,
int text_len 
)

Definition at line 177 of file encrypt.cpp.

void unencrypt_new ( char *  scrambled_text,
int  scrambled_len,
char *  text,
int text_len 
)

Definition at line 357 of file encrypt.cpp.

Variable Documentation

int Encrypt_inited = 0

Definition at line 32 of file encrypt.cpp.

const uint Encrypt_new_signature = 0x551a335c

Definition at line 24 of file encrypt.cpp.

const uint Encrypt_signature = 0xefbeadde

Definition at line 25 of file encrypt.cpp.

const uint Encrypt_signature_8bit = 0xcacacaca

Definition at line 30 of file encrypt.cpp.

ushort Lvl1_keys[NUM_LVL1_KEYS]
Initial value:
= {
0xa820, 0x71f0,
0x88da, 0x1fff,
0x2718, 0xe6a1,
0x42b8, 0x0ce9,
0x10ec, 0xd77d,
0x3fa9
}

Definition at line 295 of file encrypt.cpp.