How to encrypt data using AES in Java

I want to encrypt part of the data using AES (cbc) in java, I want to use my own IV, which I spent in an array of bytes, and my own key, stored in an array of bytes.

How can I do it?

I am looking for him to find tutorials on this topic.

+8
java cryptography encryption aes
source share
3 answers

You might be interested in this question, Java 256bit AES Encryption or Oracles Guide Using AES with Java Technology .

+3
source share

This is probably the best guide I have found on this. He explains the basics, one concept at a time, in simple words.

+11
source share

Formally, it encrypts the string in an unreadable format. Use the same code to decrypt.

ENCRYPT:

String s1="arshad"; char[] s2=s1.toCharArray(); int s3= s2.length; System.out.println(s3); int i=0; // for(int j=0;j<s3;j++) // System.out.println(s2[j]); for(i=0;i<((s3)/2);i++) { char z,f=10; z=(char) (s2[i] * f); s2[i]=s2[(s3-1)-i]; s2[(s3-1)-i]=z; String b=new String(s2); print(b); } 
0
source share

All Articles