Created
August 14, 2016 06:02
-
-
Save rxseger/331e4928f9add164489764caffe6e491 to your computer and use it in GitHub Desktop.
crypt(3) command-line wrapper, compile with: cc crypt.c -o crypt -lcrypt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <crypt.h> | |
int main(int argc, char **argv) { | |
if (argc < 3) { | |
fprintf(stderr, "usage: %s key salt\n", argv[0]); | |
return -1; | |
} | |
char *result = crypt(argv[1], argv[2]); | |
if (!result) | |
perror("crypt"); | |
else | |
puts(result); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment