/* * Platon SDG (http://platon.sk/) CVS encrypted password creator * ============================================================= * * If you are using this software you are probably requesting CVS * account on kepler.fmph.uniba.sk development server. In this case * just compile this file with following command: * * gcc -lcrypt -pedantic -Wall -o crypt crypt.c * * Run this utility (ie. by typing ./crypt) and enter password that you * want to use for accessing your CVS account. Now copy and paste your * encrypted password what should appear on output screen and send it * to Platon SDG CVS server administrator: * * Lubomir Host <8host@pauli.fmph.uniba.sk> * * Do not forget to write also username you want to use. Don't forget * also to use his GnuPG public key. You should recieve it via e-mail * or it should be attached to this program. If you either don't have * it, you can download it from following URL: * * http://pauli.fmph.uniba.sk/~8host/gpg.key * * You can import GnuPG key directly with command: * * GET http://pauli.fmph.uniba.sk/~8host/gpg.key | gpg --import * or * wget -O - http://pauli.fmph.uniba.sk/~8host/gpg.key | gpg --import * * If some problem occurs or you have some question, don't hesitate * to contact us at this e-mail address: * * * * That's all folks for now! Thank you for your interest and we are * looking for productive cooperation. * * Utility developed and procedure written * by Lubomir Host <8host@pauli.fmph.uniba.sk> * and Ondrej Jombik <9jombik@pauli.fmph.uniba.sk> * * Copyright (c) 2000-2003 Platon SDG, http://platon.sk/ * Licensed under terms of GNU General Public License. */ #include #include #include #include #include #include #define _XOPEN_SOURCE #include #define KEYBD_LEN 4096 /* KEY -- 2 characters, you can modify it as you like */ #define KEY "Gr" char *crypt(const char *key, const char *salt); int main(void) { char *passwd[2]; if ( (passwd[1] = getpass("Password: ")) == NULL || (passwd[1] = strdup(passwd[1])) == NULL || (passwd[0] = getpass("Verification: ")) == NULL) { if (passwd[1] != NULL) free(passwd[1]); fputs("Memory allocation failure\n", stderr); return 8; } if (strcmp(passwd[0], passwd[1])) { free(passwd[1]); fputs("Passwords do not match\n", stderr); return 4; } free(passwd[1]); if (strlen(passwd[0]) <= 0) { fputs("Empty passwords are not allowed\n", stderr); return 2; } puts("Your encrypted password follows on next line:"); puts(crypt(passwd[0], KEY)); return 0; } /* vim:set ts=4 */