Monday, May 22, 2017

Encrypt with password in C

 crypt, crypt_r - password and data encryption

SYNOPSIS
       #define _XOPEN_SOURCE       /* See feature_test_macros(7) */
       #include

       char *crypt(const char *key, const char *salt);

       #define _GNU_SOURCE         /* See feature_test_macros(7) */
       #include

       char *crypt_r(const char *key, const char *salt,
                     struct crypt_data *data);

       Link with -lcrypt.



 encrypt, setkey, encrypt_r, setkey_r - encrypt 64-bit messages

SYNOPSIS
       #define _XOPEN_SOURCE       /* See feature_test_macros(7) */
       #include

       void encrypt(char block[64], int edflag);

       #define _XOPEN_SOURCE       /* See feature_test_macros(7) */
       #include

       void setkey(const char *key);

       #define _GNU_SOURCE         /* See feature_test_macros(7) */
       #include

       void setkey_r(const char *key, struct crypt_data *data);
       void encrypt_r(char *block, int edflag, struct crypt_data *data);

       Each of these requires linking with -lcrypt.
 

No comments:

Blog Archive