Belajar Java SE
15/06/2020
Halo sobat Belajar Java SE berikut video tutorial kami yang kedua, kali ini mebahas tentang heading HTML yuk simak bersama, jangan lupa subscribe, like, comment dan nyalakan lonceng ya untuk dapat notif dari video-video kami terbaru
Pengenalan Heading HTML - Part 2 Halo teman-teman BPP (Belajar Programming Pemula), berikut adalah video tutorial dasar HTML (Hypertext Markup Language) lanjutan dari video sebelumnya kali i...
22/08/2014
# Materi Cryptography pada java : Sumber referensi : http://www.c-sharpcorner.com/UploadFile/433c33/working-with-cipher-class-in-java-for-achieving-cryptograph/
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.swing.JOptionPane;
public class CryptographynyA {
public static void main(String[] args) throws Exception {
// create a key generator based upon the Blowfish cipher
KeyGenerator keygenerator = KeyGenerator.getInstance("Blowfish");
// create a key
SecretKey secretkey = keygenerator.generateKey();
// create a cipher based upon Blowfish
Cipher cipher = Cipher.getInstance("Blowfish");
// initialise cipher to with secret key
cipher.init(Cipher.ENCRYPT_MODE, secretkey);
// get the text to encrypt
String inputText = JOptionPane.showInputDialog("Input your message: ");
// encrypt message
byte[] encrypted = cipher.doFinal(inputText.getBytes());
// re-initialise the cipher to be in decrypt mode
cipher.init(Cipher.DECRYPT_MODE, secretkey);
// decrypt message
byte[] decrypted = cipher.doFinal(encrypted);
// and display the results
JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),
"Enter text for Encryption: " + new String(encrypted) + "\n"
+ "Decryted tag: " + new String(decrypted));
// end example
System.exit(0);
}
}
Working With Cipher Class in Java (For Achieving Cryptographic Security) In this article we are going to describe a crypto graphic data security by using cipher class of java. I describe a Cipher class with its constructor or method details. And I give you example that's why you can easily understands its uses.
Click here to claim your Sponsored Listing.
Category
Contact the business
Telephone
Website
Address
Bandar