Java program to encrypt an image using crypto package
i had to transfer an image over network. i thought to first encrypt it.
at sender i am using:
Code :
Image image;//
Cipher c=Cipher.gentIstance("DES/CBC/KCS5padding");
SealedObject so=new SealedObject(i,c);
out.writeObject(so);//out is objectoutputstream object
at reciever:
Code :
Image image;
Cipher c=Cipher.gentIstance("DES/CBC/KCS5padding");
if((c=(Cipher)in.readObject())!=null){ //in is objectinputstream
object
image=((Image)so.getObject(c));//
}
i knows i am wrong somewhere but i actually don't understand how to use
crypto package plz help and send me correct code
Re: transferring and recieving encryted objects over a network
Hello vikas, welcome to the forums.
Does this link help?
An Introduction to Cryptography and the Java Cryptography Extension
If not, please post your code and give us more information about the problem.