Hi boss,

     You can use your own way of encryption and
decryption mechanism. pls go through the following
snippet which might solve your problem. you can keep
some more additional characters are remove some
characters from the string Alphabet.
public class encryptpwd
{

    public encryptpwd()
    {
    }

    public void getEncryptedString()
    {
    }

    public static String setEncryptedString(String s)
    {
        String s1 = "";
        String s2 = s;
        int i = 0;
        int j = 0;
        int k = 0;
        int l = 0;
        while(k < s2.length())
        {
            i <<= 8;
            i += s2.charAt(k++) & 0xff;
            for(j += 8; j >= 6;)
            {
                j -= 6;
                int i1 = i >> j & 0x3f;
                s1 = s1 + Alphabet.charAt(i1);
                if(++l >= 76)
                {
                    s1 = s1 + "\r\n";
                    l -= 76;
                }
            }

        }
        if(j > 0)
        {
            int j1 = i << 6 - j & 0x3f;
            s1 = s1 + Alphabet.charAt(j1);
            l++;
        }
        for(; l % 4 > 0; l++)
            s1 = s1 + "=";

        if(l > 0)
            s1 = s1 + "\r\n";
        encryptstr = s1;
        return encryptstr;
    }

    static String encryptstr = "";
    protected static String
Alphabet=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

}

If it suits your need get back to me.

-Dasamanthula Srinivas patnaik.
--- Madhu Vadlapudi <[EMAIL PROTECTED]> wrote:
> HI,
>
> As i am using JSP for my web application. Here to
> authenticate a user i am
> using Oracle as backend. But in the form submission
> i am using POST method,
> eventhough it hides the header but not the contents
> such as password. So i want
> to encrypt the password and aging decrypt that at
> the server side. I am using
> tmomcat 3.2.x as my webserver.
>
> Somebody might have the solution to the above
> problem. Snippet or suggestions
> are helpful.
>
> --
> V Madhu,
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED]
> and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives:
>
http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
>
http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help:
> http://www.lsoft.com/manuals/user/user.html
>


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to