Results 1 to 4 of 4
  1. #1
    bugmenot is offline Member
    Join Date
    Jan 2009
    Posts
    6
    Rep Power
    0

    Default Image Encryption

    Hi everybody ,,,,i'm a final year student B.tech COmputer ,my project is on Secure DATA tRANSMISSION,in thata i'm not able to do encryption of image ,will anybody help me.......hurry up

  2. #2
    makpandian's Avatar
    makpandian is offline Senior Member
    Join Date
    Dec 2008
    Location
    Chennai
    Posts
    450
    Rep Power
    6

    Default

    What do you think about image encryption?
    Will you please tell me a bit more about it?
    Mak
    (Living @ Virtual World)

  3. #3
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    841
    Rep Power
    6

    Default

    Hi,
    iam not sure about image encryption.But i sured in the net.Please go thru this link whether it can help u out.
    It is not allowing me to send the link.go thru sun forum.add http before //forums.

    //forums.sun.com/thread.jspa?threadID=5342409

  4. #4
    neilcoffey is offline Senior Member
    Join Date
    Nov 2008
    Posts
    286
    Rep Power
    6

    Default

    If your question is "how do I perform encryption in Java", then have a look at some stuff I've written on Java cryptography, in partcular the section on symmetric key encryption. Essentially, you create some secret key, which can just be a string of random bytes generated with SecureRandom:

    Java Code:
    byte[] key = new byte[16];
    (new SecureRandom()).nextBytes(key);
    Then you construct a Cipher object and init it with the key, then pass it the data you need to encrypt:

    Java Code:
    public byte[] encryptData(byte[] key, byte[] data) {
      Cipher c = Cipher.getInstance("AES/CTR/PKCS5PADDING");
      byte[] initialCounter = new byte[16];
      c.init(Cipher.ENCRYPT_MODE,
        new SecretKeySpec(key, "AES"),
        new IvParameterSpec(initialCounter));
      byte[] encryptedData = c.doFinal(plaintextData);
      return encryptedData;
    }
    There's nothing necessarily very special about encrypting an image-- it's just a bunch of bytes like anything else at the end of the day.

    The main problem with cryptography is that there are various subtleties that you need to understand for it to be secure. For example, in this case I've chosen Counter Mode operation, which is generally secure, but only if you use a different key and/or initialisation vector (=initial count) with every piece of data you encrypt. Anyway, read some of my articles, plus other stuff on the web-- it's a fascinating subject.

Similar Threads

  1. Very Simple Encryption
    By AndrewM16921 in forum New To Java
    Replies: 5
    Last Post: 03-24-2009, 01:00 PM
  2. Encryption/Decryption
    By Echilon in forum New To Java
    Replies: 2
    Last Post: 03-24-2009, 11:58 AM
  3. encryption
    By Joe2003 in forum Advanced Java
    Replies: 2
    Last Post: 02-06-2008, 10:27 AM
  4. Encryption/Decryption Through AOP
    By SirRawlins in forum Advanced Java
    Replies: 0
    Last Post: 12-19-2007, 03:22 PM
  5. Encryption in java
    By Ed in forum Advanced Java
    Replies: 1
    Last Post: 07-09-2007, 01:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •