Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Java program to encrypt an image using crypto package

  1. #1
    Junior Member
    Join Date
    Jun 2009
    Thanked 0 Times in 0 Posts

    Default 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:

    Image image;//
    Cipher c=Cipher.gentIstance("DES/CBC/KCS5padding");
     SealedObject so=new SealedObject(i,c);
    out.writeObject(so);//out is objectoutputstream object

    at reciever:

    Image image;
    Cipher c=Cipher.gentIstance("DES/CBC/KCS5padding");
    if((c=(Cipher)in.readObject())!=null){          //in is objectinputstream

    i knows i am wrong somewhere but i actually don't understand how to use
    crypto package plz help and send me correct code
    Last edited by JavaPF; July 7th, 2009 at 03:25 AM. Reason: Please use [code] [/code] tags

  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    United Kingdom
    My Mood
    Thanked 293 Times in 226 Posts
    Blog Entries

    Default 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.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

Similar Threads

  1. Replies: 6
    Last Post: May 15th, 2009, 05:06 PM
  2. Object creation from a input file and storing in an Array list
    By LabX in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: May 14th, 2009, 03:52 AM