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

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 order to run this project. Just follow the readme that is included in the download.

2. You must include a reference to CAPICOM in order to use it from within visual basic. All you have to do is go to *project* in the visual basic menu, then *references*. Tick the CAPICOM type library and hit ok, now you should be ready to go.

General Information:
Shows how to encode a message from base64 and back.
Shows how to generate a secure random number. (Number is hex).
Shows how to generate a hash value.
Shows how to encrypt a binary file. *Make sure you do this on a copy*
Shows how to encrypt a simple text message.

Disclaimer:
USE THIS AT YOUR OWN RISK.

Side Notes:
1. I did zero error handling in this project and didn't test much for incorrect values. In a real project, you would need to add all kinds of error handling code and of course test for incorrect values.

2. Remember this library is simply a wrapper around the windows library. If your running this on windows 98, it will NOT support the same algorithms and key sizes as windows XP.

3. I did lazy file handling for the binary example. I simply loaded an entire file into a buffer and then zipped it through the process. This is fine and dandy until you go to encrypt something like a dvd lol.

4. I just picked out general algorithms to use for the examples, md5 for hash and 3des for encryption. Everything has been mapped out via intellisense in capicom, so as your typing out the function or property, it will popup with your options. Thus I didn't feel the need to comment them out for you.

5. Make sure you use the latest release of capicom when you run this project.

Think thats about it,
Enjoy

 

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


In regards to CVMichael's Encryption technique... -
In regards to your encryption program, you repeat the hashing every 16 bytes, correct? Each hash being 16 bytes itself, what happened if you did it every, say, 10 bytes, obliterating the previous hash? Could that make it more secure? Then again, I know nothing about this subject, an


my encryption algorithm. But is it secure -
I have devised an encryption algorithm, basically it goes like this: The key is taken and SHA-1 hashed. this creates a 40 key long string. this string is stored in an array with one character in each variable of the array. the first 40 characters of the message are stored in another


[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


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


Eisecure asymmetric encryption -
From what a can see from a brief excusion into capicom dll, is that the following symmetric encryption algorithms can be implemented: RSA RC2 encryption, RSA RC4 encryption, DES encryption, or triple DES encryption. The example in MSDN only uses symmetric encryption, but I was i


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


Dummy Encrypt -
It wlll add a random number between 0-9 to every sencond charcter in a string i find it very usfull if u are trying to use base64 on a more protected level as if u encrypt the same string twice the output would be different as it insterts random numbers even tho this isent as advance a


VB - 128, 160 and 256 Bit File Encryption/Decryption with MD5, SHA1 and SHA256 -
For those of you who think that hashing is used for one way encryption only, you need to learn how to think "outside of the box" This project is using the well known MD5, SHA1 and SHA256 to encrypt and decrypt files. I came up with the algorithm myself sometime last year,


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


Encryption questions -
I would like to write an encryption program. I am planning on using Rijndael encryption algorithm using the 256 bit key. Question the 256 bit key is that just 32 standard ASCII characters? 8 bits= 1 byte= 1character? In dealing with the password, key is it better to maybe hash


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 ,


One-Time Pad Encryption -
My company just had me lead the development team for a new encryption program we were releasing. It basically broke down a password with the ascii numbers and put them through an algorithm. Using the algorithm results, it reads fifty numbers out of a random encrypted list (the pad) of


base64 to jpg -
I have a jpg converted into base64 for xml export. What I now need to do is read the base64 and save it into a database (using Access for now; will eventually move to SQL...if this makes a difference). All I find is soultions for .net; currently using VB6 - so I need help in 2 are


Random vs Binary files Performance -
Can anyone tell me if there is a difference in speed between openig random files and binary files ? My program processes files containing fixed length records - so I can use random access (get and put the record numbers) or binary access (using Seek to get to the right position - recl


[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


Add Powerful Encryption To Your Visual Basic Programs -
I thought I would show you an easy way to add powerful encryption to your visual basic programs. Up till now, you either had to write the chipers in a fast language like C or deal with the CryptoAPI. Either way you went, it was very complex with uneven documentation. But lucky for the


Network Security Conundrum -
Alrite, so I'm ready to use the Capicom encryption component from microsoft to secure some messages between a client app and a server app. I plan on having them send certain messages back and forth that are often times identical, but their quantity is important. Anyways, here is the


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


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


Cracker Challenge #6 -
Ok.. im fed up with all those smart asses out there mocking the PE Protector i wrote some time ago... The system is pretty secure and if u dont believe me.. try for yourself... Try cracking the attached EXE. The program attached is a simple program that generates a random number. Ba


base64 -
i made a base64 dll for training and compare perfs with other people : I am so slow since I do it through strings. Even if I build tables at class initialize event to lookup instead computing, I am still terribly slow eg :123 --> MTIz 1 gives immediately M and 3 gives z just


The power of RND -
Hi, I'm making a program that will need to randomize two numbers. The problem is that the numbers are not close to each other like 1 to 2. The numbers are something like 2 to 6. But you understand, I only want to random one of those two numbers. If I said: intNumber = int((6 * RND) +


MD5 Encryption... -
Can MD5 Hash encryption be decrypted? I'm using the MD5CryptoServiceProvider Thanx, Squirrelly1


Binary file creation -
I've been going through several tutorials on different methods of File Access, Text, Random, Binary, etc. I'm wanting to save the users passwords in a file that someone can't easily view. I've also seen several different methods on encryption. My first thought was that binary mode w


Problems with priority and speed of Pseudo Random Generator -
I have written a program to generate Pseudo Random Data, but I am facing certain problems with the speed of the generation. The problem I am facing is that if a user enters a number, ex: 1,2 etc., the program generates a pseudo random file of 1,2...MB. I am using this way: -


[2008] Encryption / Decryption -
What I need is a SIMPLE encryption / decryption system for vb.net. But I need it in 2 different languages. I need the encryption part fro php, and a function in vb.net that can decrypt it. Think anyone can help? It doesn't need to be strong, but the stronger the better. Try to m


Hash code -
i know hash code it creates a fixed-length array of bytes given a block of data of any length. More importantly, the hash code generated is mathematically guaranteed to be random and unique and not particularly affine to the data. so where can i apply this to my application for e


*Resolved* Public-private key encryption -
Admitted, I am not the great matmatical genious, so I need a little help on making a public-private key encryption system to use with secure IRC chat etc. I know I can use SSL and I found an example of this on www.pscode.com but the problem is, that I am estalishing client-client conne


More Random Numbers! -
Hey guys, need a little help with generating some random numbers in a console application. First, Im trying to the get the program to generate 10 random numbers between 1 and 10 (Including both 1 and 10) and then display all 10 of them in the console itself on seperate lines. Ive


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


Secure file encryption -
Hi, I have a question regarding file encryption. I have read many posts here but cant find one that answers my question. If I have missed an existing post please point me in the right direction. My question: I am trying to send a file between two computers. I have a winsock r


Random Numbers -
I need a snipit of code that will give me an array of random numbers within a given range without repeating any on the numbers. I also need to specify how many random numbers to generate. Is this a simple thing ?? I am stuck with this, can anyone help. ------------------ pbell@dpygb.


Binary(1101101) anding any idea how do do this -
I have 2 binary numbers ie 11100101 and 11111111 I need to and these numbers of 1 and 1 is 1, 1 and 0 is 0 These actual numbers are 32 bits and break down IP's i.e 206.155.178.111 would be 11001110.10011011.10110010.01101111 and the net mask would be 255.255.255.0 so the binary repi


File encryption/decryption tool hogs entire processor!!! -
Hello folks, I have created a file encryption/decryption tool. When the file size is small it works fine but when the file size is big say 1Mb or so the machine freezes till the encryption/description process is complete. How can I reduce this processor load so that other process


A "Random" problem -
Following on from our discussions of "Random" I have a problem I would like people to see if they can answer. Is there a "pattern" to the following set of numbers that are listed in a specific sequence as follows : 97,01,09,17,25,29,37,41,41,45,49,50,53,57,61,


Convertion Base64 ยป hexadecimal -
I'v tryed to do this convertion but it didn't work very well, i'v used a function posted at the forum in order to convert string to hex but the base64 convertion gave me binary. Anyone knows how may i solve this problem?


Anyone know a safe key encryption -
For my package file format for Times of War, I need to know how to do some key encryption. I would like it to last at least a few minutes at the hands of a hacker. Right now I'm using a master key and a random key, which works but eventually I hacked into it (the one I made which was a


Secure Website Login -
I've been working on an ASP-driven site for a few weeks and I'm now trying to implement some security. Right now my main page is LOGIN.ASP, which contains a text box for username and password and a submit button. I have the form action set to post to VALIDATE.ASP, which checks the us


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