I will try and make this idea as detailed as possible, to help the community in assisting and possibility helping others with the same problem.
My system has 60 users. Each user has a 8 digit password, ranging from 00000001-99999999. These are generated randomly to be unique by admins. This password is only used as a "check" access to my program, its not used for anything else. The program and password are both stored locally.
I would compile a database of passwords in this fashion
Password = UsersPassword Data = Randomly generated 128bit string (So every encryption is unique) NewPassword = "" For I to 20 NewPassword = NewPassword & Hash(Password, SHA_512) Next EncryptFile(Data, UserPassword, ALG)
This means, though the user password only has 10 billion guesses the password for encryption is 536870960 keys long. This becomes my stretch. As on my computer trying to decrypt such a file takes 60 seconds (this is just for concept i would make it a little faster for use).
This also means passwords are never stored in the file, but rather its the password itself which is the "check". This means a rainbowtable doesn't work, brute-forcing does and 10billion isn't huge but if it takes a second per guess the time / effort value comes into the play.
Here are the encryption/encryption I can use;
- CALG_3DES 0x00006603 Triple DES encryption algorithm.
- CALG_3DES_112 0x00006609 Two-key triple DES encryption with effective key length equal to 112 bits.
- CALG_AES 0x00006611 Advanced Encryption Standard (AES).
- CALG_AES_128 0x0000660e 128 bit AES.
- CALG_AES_192 0x0000660f 192 bit AES.
- CALG_AES_256 0x00006610 256 bit AES.
- CALG_AGREEDKEY_ANY 0x0000aa03 Temporary algorithm identifier for handles of Diffie-Hellman–agreed keys.
- CALG_CYLINK_MEK 0x0000660c An algorithm to create a 40-bit DES key that has parity bits and zeroed key bits to make its key length 64 bits.
- CALG_DES 0x00006601 DES encryption algorithm.
- CALG_DESX 0x00006604 DESX encryption algorithm.
I know CALG_AES_256 is extremely strong but from my tests runs very fast. I need a slow one, CALG_AES_192 seams to take longer and from my research is equally unbreakable.
Is this a valid idea?