Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygencrypt_lmhash.c
Go to the documentation of this file.
00001 /* 00002 * Copyright 2004 Hans Leidekker 00003 * 00004 * Based on LMHash.c from libcifs 00005 * 00006 * Copyright (C) 2004 by Christopher R. Hertel 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public 00010 * License as published by the Free Software Foundation; either 00011 * version 2.1 of the License, or (at your option) any later version. 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 St, Fifth Floor, Boston, MA 02110-1301, USA 00021 */ 00022 00023 #include <advapi32.h> 00024 00025 static const unsigned char CRYPT_LMhash_Magic[8] = 00026 { 'K', 'G', 'S', '!', '@', '#', '$', '%' }; 00027 00028 static void CRYPT_LMhash( unsigned char *dst, const unsigned char *pwd, const int len ) 00029 { 00030 int i, max = 14; 00031 unsigned char tmp_pwd[14] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; 00032 00033 max = len > max ? max : len; 00034 00035 for (i = 0; i < max; i++) 00036 tmp_pwd[i] = pwd[i]; 00037 00038 CRYPT_DEShash( dst, tmp_pwd, CRYPT_LMhash_Magic ); 00039 CRYPT_DEShash( &dst[8], &tmp_pwd[7], CRYPT_LMhash_Magic ); 00040 } 00041 00042 NTSTATUS WINAPI SystemFunction006( LPCSTR password, LPSTR hash ) 00043 { 00044 CRYPT_LMhash( (unsigned char*)hash, (const unsigned char*)password, strlen(password) ); 00045 00046 return STATUS_SUCCESS; 00047 } Generated on Sat May 26 2012 04:21:08 for ReactOS by
1.7.6.1
|