crypt.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef _CRYPT_H
  2. #define _CRYPT_H
  3. #include <stdio.h>
  4. #ifdef HAVE_CONFIG_H
  5. # include "config.h"
  6. #endif
  7. #include <sys/types.h>
  8. #include "src/crypto/crypto.h"
  9. #include "users.h"
  10. #define SHA_HASH_LENGTH (SHA_DIGEST_LENGTH << 1)
  11. #define MD5_HASH_LENGTH (MD5_DIGEST_LENGTH << 1)
  12. #define md5cmp(hash, string) strcmp(hash, MD5(string))
  13. char *MD5(const char *);
  14. char *MD5FILE(const char *);
  15. char *SHA1(const char *);
  16. unsigned char *encrypt_binary(const char *, unsigned char *, size_t *);
  17. unsigned char *decrypt_binary(const char *, unsigned char *, size_t *);
  18. char *encrypt_string(const char *, char *);
  19. char *decrypt_string(const char *, char *);
  20. void encrypt_cmd_pass(char *, char *);
  21. char *encrypt_pass(struct userrec *, char *);
  22. char *decrypt_pass(struct userrec *);
  23. char *cryptit (char *);
  24. char *decryptit (char *);
  25. int lfprintf (FILE *, const char *, ...) __attribute__((format(printf, 2, 3)));
  26. void Encrypt_File(char *, char *);
  27. void Decrypt_File(char *, char *);
  28. char *btoh(const unsigned char *, size_t);
  29. void do_crypt_console();
  30. #endif /* !_CRYPT_H */