Home    Personal    Work    Computers    Miscellaneous

LaTeX    Software Projects    Rendering Tutorial    UNIX Commands    Using CVS    Case Modding    Base Wiki

How to use crypt() to create encrypted password strings

[aliekens@bmt-pc04 personal]$ cat crypt.cpp
#define _XOPEN_SOURCE
#include <unistd.h>
#include <iostream>
int main( int argc, char* argv[] ) {
        if( argc < 3 )
                std::cout << "Usage: " << argv[ 0 ] << " key salt" << std::endl;
        else
                std::cout << crypt( argv[ 1 ], argv[ 2 ] ) << std::endl;
}
[aliekens@bmt-pc04 personal]$ g++ crypt.cpp -lcrypt -o crypt
[aliekens@bmt-pc04 personal]$ ./crypt blah ab
ab1O6rZcXQgWU

Edit (locked) - History - Recent Changes - Search - Statistics
All contents copyrighted 2000-2006 Anthony Liekens unless otherwise noted. Powered by PmWiki
Page last modified on October 14, 2005, at 01:45 PM.