o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

CAPICOM Hash returning different values -

Hi all,

I have a function which is in both a DLL on my website and in an EXE locally, the function gets the hash of a file, requests a hash of a file from the website (using the dll) and if they are different updates the website file. However even when I know the file is an exact copy the hashes are both different!!!

Here's my function: (it requires CAPICOM v2.0)

VB Code:
  1. Private Function HashFile(filename As String) As String
  2.     Const lngChunkSize = 100000
  3.     Dim theHash As CAPICOM.HashedData
  4.     Dim lngFreeFile As Long
  5.     Dim strChunk As String
  6.    
  7.     Set theHash = New CAPICOM.HashedData
  8.    
  9.     theHash.Algorithm = CAPICOM_HASH_ALGORITHM_MD5
  10.    
  11.     lngFreeFile = FreeFile
  12.    
  13.     Open filename For Binary Access Read As lngFreeFile
  14.     Do
  15.         If lngChunkSize > LOF(lngFreeFile) - Loc(lngFreeFile) Then
  16.             strChunk = Space$(LOF(lngFreeFile) - Loc(lngFreeFile))
  17.         Else
  18.             strChunk = Space$(lngChunkSize)
  19.         End If
  20.         Get lngFreeFile, , strChunk
  21.         theHash.Hash strChunk
  22.     Loop Until Loc(lngFreeFile) = LOF(lngFreeFile)
  23.     Close lngFreeFile
  24.    
  25.     HashFile = theHash.Value
  26.    
  27.     Set theHash = Nothing
  28. End Function

 

Storing End-User Passwords In SQL Server Tables -
I am building a web application using SQL Server and VBScript ASPs. I would normally use CAPICOM to hash the passwords and store them in a user table. When the user wants to log in, I hash the string he supplied during the challenge and compare it to the value stored in the DB. Th


CAPICOM prerequitsites (RESOLVED) -
Hello everybody I want to use CAPICOM to digitally encrypt a password in my application. I know that CAPICOM is based on CryptoAPI. I have downloaded and installed the latest Microsoft SDK. Does this contain both the CAPICOM and CryptoAPI libraries? Also, in order to use CAPICOM wha


Hash, base64, binary encryption, secure random numbers [CAPICOM] -
I got bored today and decided I'd write a better example of using the CAPICOM library with visual basic. Requirements: Version: CAPICOM 2.1.0.1 http://www.microsoft.com/downloads/d...DisplayLang=en Instructions: 1. You will need to download and install this CAPICOM library in


[VB6] CryptoAPI MD5 Hash -
The attached project is a simple demonstration of using the Windows Crypto functions to create a hash. The example produces an MD5 hash of a file or a typed in string and returns it in hex. It could easily be modified to return a Byte array of the hash, and could also easily perfor


Hash function -
I was testing the Hash function today. And I read here http://il2.php.net/manual/en/function.hash.php If I set the parameter $raw_output=true the function will return a binary rows instead of hexits values. But when I try it it returns a strange characters instead of binary value


Exception while publishing project -
Hi all, When I am publishing my project I ma getting following exception pls let me know if any body know the solution: Error 2 SignTool reported an error 'Failed to sign bin\Release\WitnessAVI.publish\\setup.exe. SignTool Error: Signtool requires CAPICOM version 2.1.0.1


perl hash -
I have a function that is returning a Hash, the problem is, i don't know the keys. Is there a way to figure out the keys? thanks


I cant read from a Perl hash CGI -
I have a cgi that i am writing. In it i read a file into a hash. Then I try to access a record in the hash like this $newvariable = $hash{'key'}; what is strange is that when i do this on my computer just running a perl script it runs fine. When i do it on my web server as a cgi


Capicom - size of encrypted field -
I am using Capicom in a web page with VBscript to create encrypted data to put it into a database field. I can't find anywhere in the online doc etc. how to know who large the field will be once it is encrypted. Is there a way to know that, or is there a way to control that? I need


[resolved] [2005] securing an md5 hash -
hi, i need an advice. i am going to be using an md5 hash for login, BUT... i really need this to be secure. i could store that hash in an exe [write back to the program], but there's a problem there since it is possible to edit the program and replace the hash with a known one... what


CAPICOM Hash returning different values -
Hi all, I have a function which is in both a DLL on my website and in an EXE locally, the function gets the hash of a file, requests a hash of a file from the website (using the dll) and if they are different updates the website file. However even when I know the file is an exact co


VB2008 - Need help with Hash Tables -
Hi all, I'm using VB .NET 2008 I'm new to hash tables and i'm trying to work out how to incorporate one hash table inside another. Here's the scenario. I'm tracking aircraft. One hash table will contain one key pair for every aircraft currently visible. The other hash table


Make executable hash itself -
Hello, I would like an executable to hash itself when it starts and compare the hash with the hash it should be. If the hash isn't the same, then the application should close. The hashing itself is not a problem but how do I get the correct hash of the application and then later add


Binary search tree and hash table combined -
I need serious help before I go on kill myself I've been starting over and over several times now. The task given is to use two data structures, Hash table & Binary search tree for the same set of data. The hash table should be implemented as an array. The actual data value is st


UDT to MD5 -
Has anyone tried to get the MD5 hash of an UDT? I'm getting and sending a type through sockets and need to check/send the hash of the message body, but right now I have no way of checking if the values I'm getting are right or are completely wrong since I've never used MD5. I have t


Hash Tables .... -
i have a project , about hash tables , i have to reference all courses in my university with credits etc .. and i am supposed to use Hash Tables ... the thing is i did not attend the lecture where the professor explained it ... and the book is horrible .. anyone has any idea where i c


[2005] MD5 hash of string -
I got a phpbb board running (on PHP/MySQL naturally). I want to use the phpbb user database for my own purposes. To be able to do so I need to compare the hash value the user enter against the stored hash value. I'm not able to coreectly compute the hash. I tried fiddling with


Hash password probabilities -
Still learning about how hashes work, so I don't know if this question even makes sense. As I understand it, it's possible for a hash to represent more than one combination of characters. Say I have an authentication system which verifies a user password based on a hash. Is there a ce


A doubt in VB and ASP -
Hi, I have a doubt. In Web-pages, Which is a better method of the following to return values using VB components. 1. Returning values as Arrays. or 2. Returning values as Recordsets. and if possible please do let me know the reason why one between the two is bette


WinMX Hash Coding -
Got a question for anyone that can answer.. Well I was told the WinMX uses MD5 Checksum hashing but I tried using a few MD5 hash codes and resulted in diffrent hashs each time. Does anyone know what which hash code winmx uses? And if so, anywhere to a get a code (module or someth


Question about hashing... -
If you hash a file, is there a way to unhash it? I have a class that uses the MD5 and SHA hash algorithms, and I just came up with an idea for a program that will hash any type of text file in Windows.


How to create a Hash -
I'd like to create the same hashes that windows does, i know it uses LM HASH and NT HASH. I'd like to know if there is any function or api to create the same hash that windows does. for exemple, this hash: 36c3363007203fd4aad3b435b51404ee was created for the password: 12ast89 i t


What is a hash table -
I've got a question. What is a hash table? I tried looking for the term in my VB.NET book (learn vb.net in 21 days) but it doesn't have anything on hash tables.


Capicom and crypt binary files -
Hi ,i'm looking for a dll to encrypt birnary and text files , i think that capicom dll can do it ,but it's possible to encrypt binary files? ,i had tryed but i can't ,does anybody can show me an example? Thanks ,


Need Help Getting SHA1 value of File -
I'm trying to write a routine to get the SAH1 hash value of graphics and video files. Can find lots of docs on how to hash a password but none on how to get the hash of a file. It appears that GetHashFromFile is what I need to use but I could use some example code. Am using VB.Net 20


reHash() produce weird result -
I have rehash() which working just fine. right before it goes out of the method. what it does is make a new hash which is basically an array that is 20 bigger than the old hash. I copied the value from one hash to another and it's working just fine. I even print them out after I did


Hash Table -
Hi All; I have a problem with hash table in the SQL server 2000. I can not read from it in both VB6 and VB.Net. I have a stored procedure in the SQL database and it create a hash table and fill with some data after some processes. After I run the stored from my application and try to


Case Sensitive Passwords (Hash) -
I have been using this article to create a password hash that I am saving into a MSSQL 2000 database. Everything seems to be working correctly, and cases are being stored along with the hash, however upon validating the passwords cases are not being taken into consideration. How


SHA1 Hash -
G'Day! Say for example a SHA1 Hash of poo.zip is: ea8d7a90372a331576e7a3ab20721085ad847d22 Is it possible to calculate the EXACT same hash without the file present using only the filename and/or size of the file? Cheers.


[02/03] Get md5 hash code in a running application. -
I've seen a code that could generate md5 hash code and tried it but the problem when you get the md5 hash code of running application it throws an exception that the file cannot be accessed because it is being used by another process. My question is how could I still retrieve the md5 h


trying to suppress OverflowException in hash calculation -
Hi I'm trying to mimc the java HashCode method as shwon below. . I’m not able to suppress overflowexception in VB so the value does’nt match exactly what I get in Java. For example, hash'ing the string “test” and it matches java version. But hash “tester” and the 4-b


How to calculate MD5 hash of current vb6 .exe on runtime -
Hi all. I wonder how i calculate MD5 hash of current vb6 exe on runtime ? I want to do integrity check with a MD5 hash during run time and send that value for server for checking. could any one show me how this can be done?Thanks


Functions returning two values -
Hi! Is it possible to make a user-defined function return two values? How do i do it? Wat i understand about returning values is this: Public function myfunction(parameter) as integer myfunction="resulting value" end function Private Sub Command1_Click() retu


NEED HELP With Recordset!!!! -
Hi Guys I'm returning a Recordset with Integer Values.My problem is that some of these values are repeated...but those are the values i want to keep,including how many times they appear. Eg: Values returned 1 2 2 3


how to supress OverflowException -
Hi I'm trying to mimc the java HashCode method as shon below. . I’m not able to suppress overflowexception in VB so the value does’nt match exactly what I get in Java. For example, hash'ing the string “test” and it matches java version. But hash “tester” and the 4-byte


Finding .Top & .Left Values -
I tried to find the paramaters (values) of Image3.Top and Image3.Left, but whenever I go: MsgBox Image3.Top and the same for Image3.Left, It keeps returning zeroes, but for width and height it's returning me the proper values. How can I find out the right parameters?


Salted Hash -
Does VB6 have any inbuilt functionality to generate a salted hash? I want to use this to generate a password. So I will be supplied a password and the code will return a salted hash which I will be storing in the registry. Any ideas?


hash functions -
vb guru's how can i hash 20 names into 30 locations, and count number of collisions using entire name as key.


Hash code question -
Hi all, If you convert a string to a hash code using the GetHashCode() method, how do you convert the Hash code value back to a string?? I did this to encrypt a password. Any ideas??


CAPICOM 3DES not working in a few machines -
hello, i am using capicom.dll and try using 3des and developed a activex component. This activex works in some machines but in other machines it just gives me error. if i switch to des it works in all the machines. any one knows y 3des works in a few machines and not in a couple of o