AES stands for Advanced Encryption Standard. AES is an Symmetric Key Algorithm, that means key used for encrypting the data, same key will be used for decryption of the encrypted data. This algorithm supplants DES algorithm. This post shows how to use AES algorithm in Java to encrypt and decrypt data. Encrypting Data- import java.security.GeneralSecurityException; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; public class AESTest1 { public static void main(String[] args) throws GeneralSecurityException { KeyGenerator keyGenerator = KeyGenerator.getInstance("AES"); keyGenerator.init(128); SecretKey key = keyGenerator.generateKey(); Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.ENCRYPT_MODE, key); byte encryptedData[] = cipher.doFinal(args[0].getBytes()); } } In above example we have used KeyGenerator class, which generates key for encrypting data, as we are using...
Oh my that is a bummer.Why don't you try the geek squad.Those guys are so good at data recovery and always make regular backups.I personally use an online backup called www.safecopybackup.com.It is so cheap and the setup alone does not even take more than 2minutes.It is what i use and it has kept all my files secure.And now they have upgraded all the spaces and they are now also offering a free unlimited 5GB trial version to its clients
ReplyDeleteOoh no! your experience such a traumatic moment but good you learn a hard way. Next time backup online to avoid those headaches. Like Dorothy, I too use safecopybackup. am happy with it. Try it, you'll be glad you did!
ReplyDelete