#include <stdio.h>
#include <stdlib.h>

#include <unistd.h>
#include <crypt.h>

int main(int argc, char * argv[])
{
    puts(crypt(getpass("Password: "), crypt_gensalt(
        argc >= 2 ?      argv[1]  : NULL,
        argc >= 3 ? atoi(argv[2]) : 0,
        NULL,
        0
    )));
}
