<p>I need to store some sensitive data by encrypting it with atleast 128 bit key. I investigated into javax.crypto package and found that there are certain Cipher names, like 
PBEWithMD5AndDES or PBEWithSHA1AndDESede which provides encryption upto 56 bit and 80 bit (<a href="http://en.wikipedia.org/wiki/DESede" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/DESede</a>).</p>

<p>I referred other guys posts but those are mainly using RSA and in my understanding RSA is generally suitable for encrypting the communication data (with private-public key pair). My need is different, I just want to store the data and retrieve it back by decrypting it. Therefore I don't need any private-public key pairs.</p>

<p>Please let me know if you have any idea about this.</p>

[{'answer_id': 49230, 'author': 'Tony BenBrahim', 'author_id': 80075, 'author_profile': 'https://Stackoverflow.com/users/80075', 'pm_score': 2, 'selected': False, 'text': '<p>You need to download and install the unlimited strength JCE policy file for your JDK. For JDK 6, it is on <a href="http://java.sun.com/javase/downloads/index.jsp" rel="nofollow noreferrer">http://java.sun.com/javase/downloads/index.jsp</a> at the very bottom.</p>\n'}, {'answer_id': 49235, 'author': 'Mike Stone', 'author_id': 122, 'author_profile': 'https://Stackoverflow.com/users/122', 'pm_score': 0, 'selected': False, 'text': '<p>I\'m not a crypto expert by any means (so take this suggestion with a grain of salt), but I have used <a href="http://en.wikipedia.org/wiki/Blowfish_(cipher)" rel="nofollow noreferrer">Blowfish</a> before, and I think you can use it for what you need.  There is also a newer algorithm by the same guy called <a href="http://en.wikipedia.org/wiki/Twofish" rel="nofollow noreferrer">Twofish</a>.</p>\n\n<p>Here is a <a href="http://www.hotpixel.net/software.html" rel="nofollow noreferrer">website with a Java implementation</a>, but be careful of the license (it says free for non-commercial use).  You can find that link also from <a href="http://www.schneier.com/blowfish-download.html" rel="nofollow noreferrer">Bruce Schneier\'s website</a> (the creator of both algorithms).</p>\n'}, {'answer_id': 49256, 'author': 'Niyaz', 'author_id': 184, 'author_profile': 'https://Stackoverflow.com/users/184', 'pm_score': 4, 'selected': True, 'text': '<p>Use <a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard" rel="nofollow noreferrer">Advanced Encryption Standard</a> (AES). It supports Key lengths of 128, 192, or 256 bits.</p>\n\n<p>The <a href="http://www.hoozi.com/Articles/AESEncryption.htm" rel="nofollow noreferrer">algorithm</a> is simple. The Sun Java website has a <a href="http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html" rel="nofollow noreferrer">section explaining how to do AES</a> encryption in Java.</p>\n\n<p>From Wikipedia...</p>\n\n<blockquote>\n  <p>... the Advanced\n  Encryption Standard (AES), also known\n  as Rijndael, is a block cipher adopted\n  as an encryption standard by the U.S.\n  government. It has been analyzed\n  extensively and is now used worldwide,\n  as was the case with its\n  predecessor, the Data Encryption\n  Standard (DES)...</p>\n</blockquote>\n\n<p>So as a rule of thumb you are not supposed to use DES or its variants because it is being phased out.</p>\n\n<p>As of now, it is better to use AES. There are other options like <a href="http://en.wikipedia.org/wiki/Twofish" rel="nofollow noreferrer">Twofish</a>, <a href="http://en.wikipedia.org/wiki/Blowfish_(cipher)" rel="nofollow noreferrer">Blowfish</a> etc also. Note that Twofish can be considered as an advanced version of Blowfish.</p>\n'}, {'answer_id': 49262, 'author': 'Michael Neale', 'author_id': 699, 'author_profile': 'https://Stackoverflow.com/users/699', 'pm_score': 2, 'selected': False, 'text': '<p>I have had good success in the past with <a href="http://www.bouncycastle.org/" rel="nofollow noreferrer">http://www.bouncycastle.org/</a> (they have a C# version as well). </p>\n'}, {'answer_id': 49315, 'author': 'Tnilsson', 'author_id': 4165, 'author_profile': 'https://Stackoverflow.com/users/4165', 'pm_score': 2, 'selected': False, 'text': '<p>Combining 3 different replies gives what I think is the correct answer.</p>\n\n<p>Download encryption libraries from <a href="http://www.bouncycastle.org/java.html" rel="nofollow noreferrer">Bouncycastle</a> then you need to download the "Unlimited Strength Jurisdiction Policy" from <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" rel="nofollow noreferrer">Oracle</a> (the files are at the bottom of the download page). Make sure you read the Readme-file on how to install it. </p>\n\n<p>Once you have done this, and using the sample code supplied with the Bountycastle package you should be able to encrypt your data. You can go with a tripple DES implementation, which will give you 112 bits key (often referred to as 128 bit, but only 112 of them are actually secure), or as previously stated, you can use AES. My money would be on AES.</p>\n'}, {'answer_id': 49367, 'author': 'jatanp', 'author_id': 959, 'author_profile': 'https://Stackoverflow.com/users/959', 'pm_score': 0, 'selected': False, 'text': '<p>Thanks Michael, after trying out many things in JCE, I finally settled for bouncycastle. </p>\n\n<p>JCE supports AES for encryption and PBE for password based encryption but it does not support combination of both. I wanted the same thing and that I found in bouncycastle.</p>\n\n<p>The example is at : <a href="http://forums.sun.com/thread.jspa?messageID=4164916" rel="nofollow noreferrer">http://forums.sun.com/thread.jspa?messageID=4164916</a></p>\n'}]
['https://Stackoverflow.com/questions/49226', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/959/']