Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I’m trying to develop a system that will ask the user to enter a text in JTextBox (plainText) then it will click on key JButton (key_128) then it will encrypt the user text and show the output in another JTextBox(encryptedtext). the code now asking the user to enter the key. how i can change it to static value in JButton (key_128)

Java
byte[]  plain = plaintext.getText().getBytes();
        byte[] K = time_128.getText().getBytes();
         byte[] encrypted = encrypt(plain, K);
         String a = new String(bytesToHex(encrypted));
         encryptedtext.setText(a);


What I have tried:

i tried to use binaryCodec but that didn't work :(
Posted
Updated 24-Mar-18 21:48pm

1 solution

 
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