Previous Contents Index Next |
Setup Util Programmer's Guide |
Chapter 23 Code.h Library Reference
This chapter describes code.h, the library containing encryption and decryption functions. It contains the following sections:
Definitions
The code.h library contains these definitions.
Number of bytes a SHA-1 hash produces
Estimates the length of a base64 encoded string
#define BASE64_LEN(vlen) (((vlen) * 4 / 3 ) + 3)
The code.h library contains these functions.
The SHA-1 secure hash function. Hashes a null terminated character string "src" into "dest" using SHA-1.
static int SHA1_Hash(unsigned char *dest, char *src);
Hashes a non-null terminated string "src" into "dest" using SHA-1.
static int SHA1_HashBuf(unsigned char *dest, unsigned char *src,
Decodes a base64 encoded string.
NSAPI_EXTERN int base64_decode( char *src, unsigned char *dst );
NSAPI_EXTERN int base64_encode( unsigned char *src, char *dst, int srclen, int lenused );
Encodes a password using SHA-1 encryption.
NSAPI_EXTERN char *sha1_pw_enc( char *pwd );
Performs a comparison operation on a SHA-1 encrypted password.
NSAPI_EXTERN int sha1_pw_cmp( char *userpwd, char *dbpwd );
Previous Contents Index Next
Copyright (C) 2005 Red Hat, Inc. All rights reserved.
This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/
Last Updated April 11, 2000