Click here to Skip to main content
15,897,226 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
My question is How,When,where Rc4 or other Encryption/Decryption Algo Should b used.



such a fast response from Cp team is Appreciable(thanks).

Google is Providing only the RC4 Algo/Weakness/Strong points/Working not the info regarding the usuage.
Want to Knnow either the "Key should b stored in DB with Encrypted Cipher Text" or not?
Where do we Really need Rc4, in Saving passwords or Senstive data or just Encrpting the Sending Password at the Client Side and Storing at the DB with associated Key.
Posted
Updated 5-Oct-12 22:59pm
v2
Comments
OriginalGriff 6-Oct-12 4:44am    
That's a bit of a broad question!
Is there some reason why you don't see what Google has to offer first?

1 solution

Your question covers a lot, but here's an attempt at a general answer anyway.

As I'm sure you've found in your research, it's easy to misuse RC4 and create an insecure system. If you are just encrypting data on the server side, you may want to look into AES or at lease 3DES as they are often efficiently implemented in a database system (Oracle does AES very nicely). Also, newer processors like the i7 have AES instructions build into their instruction set.

You asked whether you should store the encryption key with the encrypted data... In almost every situation: NO. If its an asymmetric algorithm then the private key should never be transmitted across the network and the public key should not be stored with the encrypted value (otherwise access to the database gives you everything you need to decrypt the data). The same goes with a symmetric algorithm--if you store the decryption key with the encrypted data then you aren't really securing anything.

If you are looking for a way to transmit secure data to the server, then you'll want to look into finding a standardized and peer-reviewed encryption package that accomplishes exactly what you need. If you are writing a new system on an obscure platform that doesn't have any commercial encryption libraries for, then try looking into RSA and AES. Note that typically self designed systems leave security holes.

If you are doing all of this over the Internet, then perhaps you just need a site certificate which will protect your information with little effort on your part and provide a secure site indicator on the client's side.

Last of all, if you are storing passwords then maybe you aren't looking for encryption at all but rather a good hashing algorithm. These days passwords are stored salted and hashed (irreversibly encrypted). To verify whether the user entered the correct password you hash his typed password and compare that hash with the value in the database (i.e., hash(txtPassword.Text) == hash(databasePassword)). If this is what your looking for, then I'd Google around for "SHA hashing passwords."
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900