Results 1 to 8 of 8
  1. #1
    Ashwin94 is offline Member
    Join Date
    Aug 2013
    Posts
    11
    Rep Power
    0

    Exclamation encrypt and decrypt in java

    I Want an encryption and decryption code....

    please tel some simple program.........i want urgent.....

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is online now Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,404
    Rep Power
    20

    Default Re: encrypt and decrypt in java

    This is a forum, not a code factory.

    Recommended reading: How to ask questions the smart way

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,065
    Rep Power
    6

    Default Re: encrypt and decrypt in java

    Google is more than willing to comply with your demands you know. Try a google for "Java encryption example".
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default Re: encrypt and decrypt in java

    This is probably an extension of this. Converting the array the array got to difficult, not that it was much of an encryption technique.

  5. #5
    Ashwin94 is offline Member
    Join Date
    Aug 2013
    Posts
    11
    Rep Power
    0

    Default Re: encrypt and decrypt in java

    ss.....

    import java.util.*;
    import java.util.Arrays;
    class test3
    {
    public static void main(String ar[])
    {

    String str;
    Scanner in = new Scanner(System.in);
    System.out.println("Encryption");
    System.out.println("Input a string");
    str = in.nextLine();
    int length = str.length();
    char a[]=new char[length];
    char z[]=new char[length];
    int i;
    for(i=0;i<=length-1;i++)
    {
    a[i]= str.charAt(i) ;
    }
    for(i=0;i<length;i++)
    {
    int y=(int)a[i];
    System.out.println(y);
    z[i]=(char)y;
    y=0;
    }
    System.out.println("Decryption");
    for(i=0;i<length;i++)
    {
    System.out.println(z[i]);
    }
    }
    }



    I this program atlast i am storing the decrypted value in an array z[ ] .....how to convert it into an string........i tried some but not workin...plz help...

  6. #6
    Ashwin94 is offline Member
    Join Date
    Aug 2013
    Posts
    11
    Rep Power
    0

    Default Re: encrypt and decrypt in java

    Quote Originally Posted by masijade View Post
    that it was much of an encryption technique.

    i just tried ....i wil later do modification....first simple program itself not workin.....

  7. #7
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default Re: encrypt and decrypt in java

    You DO know that that is NOT encryption, right? If you actually plan on using something like this, then remember that a 2 year old can break it.

    As far as "converting it into a String", take a look at the API for String and see if one its constructors will work.

  8. #8
    DarrylBurke's Avatar
    DarrylBurke is online now Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,404
    Rep Power
    20

    Default Re: encrypt and decrypt in java

    Quote Originally Posted by Ashwin94 View Post
    ss.....

    import java.util.*;
    import java.util.Arrays;
    class test3
    {
    public static void main(String ar[])
    {

    String str;
    Scanner in = new Scanner(System.in);
    System.out.println("Encryption");
    System.out.println("Input a string");
    str = in.nextLine();
    int length = str.length();
    char a[]=new char[length];
    char z[]=new char[length];
    int i;
    for(i=0;i<=length-1;i++)
    {
    a[i]= str.charAt(i) ;
    }
    for(i=0;i<length;i++)
    {
    int y=(int)a[i];
    System.out.println(y);
    z[i]=(char)y;
    y=0;
    }
    System.out.println("Decryption");
    for(i=0;i<length;i++)
    {
    System.out.println(z[i]);
    }
    }
    }



    I this program atlast i am storing the decrypted value in an array z[ ] .....how to convert it into an string........i tried some but not workin...plz help...
    I gave you a link here to the pages on this forum that tell you how to post code. I see you didn't bother to go through them.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. encrypt to Decrypt
    By algo_avaj in forum New To Java
    Replies: 6
    Last Post: 08-07-2013, 10:11 PM
  2. Replies: 0
    Last Post: 06-11-2012, 10:52 AM
  3. Caesar Encrypt and Decrypt
    By manfredo in forum New To Java
    Replies: 11
    Last Post: 01-22-2011, 10:40 PM
  4. Need Help for encrypt/decrypt.
    By superdhebz in forum New To Java
    Replies: 5
    Last Post: 09-17-2010, 06:26 PM
  5. Encrypt and decrypt SMS
    By ZeCute in forum CLDC and MIDP
    Replies: 8
    Last Post: 06-13-2010, 05:01 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
  •