00001 /* SVN FILE INFO 00002 * $Revision: 174 $ : Last Committed Revision 00003 * $Date: 2008-06-24 10:50:29 -0700 (Tue, 24 Jun 2008) $ : Last Committed Date */ 00004 /* 00005 * Classic "Hello, world" demonstration program 00006 * 00007 * Copyright (C) 2006-2007 Christophe Devine 00008 * 00009 * This library is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU Lesser General Public 00011 * License, version 2.1 as published by the Free Software Foundation. 00012 * 00013 * This library is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with this library; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00021 * MA 02110-1301 USA 00022 */ 00023 00024 #ifndef _CRT_SECURE_NO_DEPRECATE 00025 #define _CRT_SECURE_NO_DEPRECATE 1 00026 #endif 00027 00028 #include <stdio.h> 00029 00030 #include "xyssl/md5.h" 00031 00032 int main( void ) 00033 { 00034 int i; 00035 unsigned char digest[16]; 00036 unsigned char str[] = "Hello, world!"; 00037 00038 printf( "\n MD5('%s') = ", str ); 00039 00040 md5( str, 13, digest ); 00041 00042 for( i = 0; i < 16; i++ ) 00043 printf( "%02x", digest[i] ); 00044 00045 printf( "\n\n" ); 00046 00047 #ifdef WIN32 00048 printf( " Press Enter to exit this program.\n" ); 00049 fflush( stdout ); getchar(); 00050 #endif 00051 00052 return( 0 ); 00053 }