×
Namespaces

Variants
Actions
Revision as of 16:29, 29 May 2008 by jaaura (Talk | contribs)

Libcrypt

From Nokia Developer Wiki
Jump to: navigation, search

Introduction

libcrypt is used for encrypting/decrypting of messages,passwords and blocks of data.

Functions

The main cryptographic functions in this lib are:

  • setkey
    • An utility which adds, updates, dumps, or flushes Security Association Database (SAD) entries as well as Security Policy Database (SPD) entries in the kernel.
  • encrypt
    • encrypt() function encrypts and decrypts64-bit messages. The algorithm used to perform encryption/decryption is Data Encryption Standard (DES).
    • The encrypt and setkey functions do not return any value.
    • setkey() is invoked to set the key for the DES machine.
    • If encrypt is called without priorly invoking setkey the implementation assumes a bit vector consisting of all zeroes as the key for the DES algorithm.
#include <unistd.h>  
void encrypt (char datablock[64], int flag);
 
#include <stdlib.h>
void setkey (const char *key);
  • crypt
    • The crypt function performs password hashing.
    • The crypt function returns a pointer to the encrypted value on success, and NULL on failure.
    • Currently the implementation supports Data Encryption Standard (DES) and MD5 hash algorithms
  #include <unistd.h>  
char * crypt (const char *key, const char *salt);


Links

67 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×