Results 1 to 6 of 6

Thread: Encryption Of Connection Password

  1. #1
    Join Date
    Nov 2009
    Posts
    1,340

    Encryption Of Connection Password

    Hello, I am working on one of the application, which create a connection object to the database. For that it uses the Login and password. As the end users don't know the password and it is necessary that they don't know the password of all. So, for that I want to encrypt the password so, it is not possible to decompile the binary file. So, please help me to achieve it. It will be helpful to me.

  2. #2
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Encryption Of Connection Password

    Most Jabber clients allow you to encrypt the connection. Jabber can use two methods of encryption. The oldest is the one used by websites secure connection by SSL. The port used by the server MiNET for this type of connection is port 5223. Jabber can also use a more recent technique of encryption is encryption TLS. In this case, the port used is the same as the port for messages that are clear, the port 5222. MiNET The server supports two encryption methods. How to enable encryption depends on the software you use. However, if you encrypt your connection with SSL, make sure that the port number is 5223.

  3. #3
    Join Date
    May 2008
    Posts
    2,389

    Re: Encryption Of Connection Password

    Hello, I think the code below will simply help you for encrypting the password:
    Code:
    import java.io. *;
    Public class testing
    {
        Public testing(int one)
        {
           key = one;
        }
     
        Public void encryptFile(InputFileName String, String outputFileName) throws IOException
        {       
            InputStream IStream = null;
            OutputStream oStream= null;
            try
               {
                  IStream = new FileInputStream(InputFileName);
                  oStream= new FileOutputStream(outputFileName);
                  encryptStream(IStream, out);
     
               }
           finally
               {
                 if(IStream! = null)
                    IStream.close();
                 if(out! = null)       
                    out.close();      
               }
        }
     
        Public void encryptStream(InputStream IStream, OutputStream out) throws IOException
        {
            boolean done = false;
            while(! done)
               {
                    int next = IStream.read();
                    if(next == -1)
                       done = true;
                   else
                   {
                      byte b = (byte)next;
                      byte c = encrypt(b);
                      out.write(c);
                   }
               }
        }
     
        Public byte encrypt(byte b)
        {
             return (byte)(b + key);
        }    
     
        private int key;
    }

  4. #4
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Encryption Of Connection Password

    I don't think that anything than MD5 hash is better. You can simply make use of it.
    Code:
    import java.security .*;
      private String encryption(String pass) 
    {
      byte[] UKey = pass.getBytes();
      byte[] Hash = null;
      try {
       MessageDigest Hash =.getInstance("MD5").digest(UKey);
      }
      catch (Exception e) 
    { 
       e.printStackTrace();
    }
    StringBuffer HashString = new StringBuffer();
    for (int i =0; I <Hash.length; + + I ) 
    {
    String hex = Integer.toHexString(Hash[i]);
    if (hex.length() == 1) 
    { 
    HashString.append('0');
    HashString.append(hex.charAt(hex.length()-1));
    }
    else 
    {
    HashString.append(hex.substring(hex.length()-2));
    }
    }
    return HashString.function toString() 
    {
    [native code]
    }
    }

  5. #5
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Encryption Of Connection Password

    If you want to Encrypt application configuration file then you must make use of the Jasypt. It will help you to achieve the following:
    • properties files: By making use of the EncryptableProperties class for loading, managing it, you can simply encrypt it.
    • Encryption-aware Spring's : You can simply read the files with the help of it.
    • Hibernate's hibernate.cfg.xml file contains the datasource parameter of the Encryption.

  6. #6
    Join Date
    May 2008
    Posts
    2,012

    Re: Encryption Of Connection Password

    If you want to encrypt the password then it is needed to know the password first. If you are storing the password in your source code then it is not a good idea. Or if you are saving it in the file then also it is not a good idea. Whatever happens you will have to enter a password to your user. Otherwise it will use X.509 certificates with a private key in a key store but again you'll need a password to access the store.

Similar Threads

  1. Password and encryption software by SanDisk
    By Loverface in forum Windows Software
    Replies: 6
    Last Post: 12-09-2011, 07:49 PM
  2. Weak feature in Encryption software is Password
    By Lilija in forum Networking & Security
    Replies: 5
    Last Post: 27-12-2010, 02:15 PM
  3. How to break the encryption just getting the encryption algorithm
    By Neel Kamal55 in forum Networking & Security
    Replies: 4
    Last Post: 24-12-2010, 11:55 PM
  4. Assymetric encryption vs Symmetric encryption
    By "Dritan" in forum Networking & Security
    Replies: 4
    Last Post: 23-12-2010, 08:37 AM
  5. Replies: 2
    Last Post: 22-02-2006, 03:53 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,033,624.62473 seconds with 16 queries