Print Page | Close Window

Encryption on Post Or get

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=10773
Printed Date: 30 March 2026 at 10:00pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Encryption on Post Or get
Posted By: meteor
Subject: Encryption on Post Or get
Date Posted: 07 June 2004 at 11:05am

Hello
how can I Secure My Scripts that Use login system . if a sniffer is in network then he can see my passwords so how can i encrypt or encode data transfer.is any function or algorithm to do this . like i want to encode pass word on client and send it to server and then decrypt it.



-------------
Sincerely
--------------------
http://www.TacPlusPlus.com - PowerFull Scripts For NTTacPlus



Replies:
Posted By: Mart
Date Posted: 07 June 2004 at 11:08am
Use SSL...


Posted By: meteor
Date Posted: 07 June 2004 at 1:30pm

no . except this one. i want when a user click on submit button the script encode/encrypt his/her password and then send it to server .
what is client and server side scripts . (client using java script and server asp).i think this is more secure.



-------------
Sincerely
--------------------
http://www.TacPlusPlus.com - PowerFull Scripts For NTTacPlus


Posted By: Mart
Date Posted: 07 June 2004 at 1:54pm
No that is definatley not more secure, since anybody can read and crack your encyrption on the client side. SSL is the only way really. And neither javascript or client side VBscript is powerful enough to safely encrypt data.


Posted By: pmormr
Date Posted: 07 June 2004 at 3:29pm

Now i'm not going to give this a Safest in the world security but you could always use a javascript oneway encryption function and then send the hashed password over the internet and then compare it on the server... that isn't the most seucre way but it would be better than nothing... what's better?

mypassword

or

LK4LK7J2LK4J74LK7J247JHG4O2I6G&25745852



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: pmormr
Date Posted: 07 June 2004 at 3:31pm

the windows authentication system is pretty cool... Kerberos... Send the validation packet encrypted RC4 with the user's password, and then the client sends the unencrypted packet back with another encrypted packet inside of it for the server to know that it really is the user's computer



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: Mart
Date Posted: 08 June 2004 at 3:22pm

I would not recommend any client side encryption, if this is for a login app you could use DIGEST authentication which is  a bit like BASIC authentication but an MD5 digest is sent instead of plain text.

The trouble with client side encryption is:

1) You will never get it as strong as SSL because you won't be able to handle key's etc.

2) Anybody can view your code and identify weaknesses via View Source



Posted By: pmormr
Date Posted: 08 June 2004 at 4:49pm
the best way to do it is to just use SSL... that would probably require the least work

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: dpyers
Date Posted: 08 June 2004 at 7:27pm

Ant site with any sort of security requirement at all uses SSL. You can get a FreeSSL cert for $25-$30/year US. Or you could used shared SSL if your host supports them.

Shared SSL is probably adequate for most login scripts. The user has to OK a window that says the certificate ownership is not verified, but the encryption side of it works.

Couple of useful links:
http://www.sslreview.com/ssl-certificate-content/ssl-compare-table/index.html - http://www.sslreview.com/ssl-certificate-content/ssl-compare -table/index.html
http://www.whichssl.com/index.html - http://www.whichssl.com/index.html



-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: Bluefrog
Date Posted: 09 June 2004 at 11:47am

You can do things client side, but you'll need an ActiveX control to do it, and then you have the exact same problem with normal javascript, but at a but more technical level. You'd need to have the ActiveX control encrypted itself, etc.

Encryption and compression are 2 of the most expensive core technologies in the world, and there's a reason for it. They are both close to rocket science.

Stick with SSL.

 



-------------
http://renegademinds.com/" rel="nofollow - Renegade Minds - Guitar Software http://renegademinds.com/Default.aspx?tabid=65" rel="nofollow - Slow Down Music


Posted By: meteor
Date Posted: 11 June 2004 at 6:50am


so...
give me MD5 Functions in VBscript and Jscript.
Jscript for Client side(to make One Way hash)
and VBscript For ServerSide(any idea acceptable)
yahoo use Md5 for Hash password and other. ot Vbulletin 3.0.0 use calcmd5 function(is it internal function of java because i dont found any other script to calculate md5 it seems to be internal function.)
there is no way to use SSL i should use this level Security  it is better than nothing. isnt it?



-------------
Sincerely
--------------------
http://www.TacPlusPlus.com - PowerFull Scripts For NTTacPlus


Posted By: Mart
Date Posted: 11 June 2004 at 11:15am
AFIAK there is not an MD5 hashing function for JS or VBS


Posted By: meteor
Date Posted: 11 June 2004 at 11:39am

here is a Md5 JS
[CODE]
<script language="javascript">
/*
 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
 * Digest Algorithm, as defined in RFC 1321.
 * Copyright (C) Paul Johnston 1999 - 2000.
 * Updated by Greg Holt 2000 - 2001.
 * See http://pajhome.org.uk/site/legal.html - http://pajhome.org.uk/site/legal.html for details.
 */

/*
 * Convert a 32-bit number to a hex string with ls-byte first
 */
var hex_chr = "0123456789abcdef";
function rhex(num)
{
  str = "";
  for(j = 0; j <= 3; j++)
    str += hex_chr.charAt((num >> (j * 8 + 4)) & 0x0F) +
           hex_chr.charAt((num >> (j * 8)) & 0x0F);
  return str;
}

/*
 * Convert a string to a sequence of 16-word blocks, stored as an array.
 * Append padding bits and the length, as described in the MD5 standard.
 */
function str2blks_MD5(str)
{
  nblk = ((str.length + 8) >> 6) + 1;
  blks = new Array(nblk * 16);
  for(i = 0; i < nblk * 16; i++) blks = 0;
  for(i = 0; i < str.length; i++)
    blks[i >> 2] |= str.charCodeAt(i) << ((i % 4) * 8);
  blks[i >> 2] |= 0x80 << ((i % 4) * 8);
  blks[nblk * 16 - 2] = str.length * 8;
  return blks;
}

/*
 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
 * to work around bugs in some JS interpreters.
 */
function add(x, y)
{
  var lsw = (x & 0xFFFF) + (y & 0xFFFF);
  var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  return (msw << 16) | (lsw & 0xFFFF);
}

/*
 * Bitwise rotate a 32-bit number to the left
 */
function rol(num, cnt)
{
  return (num << cnt) | (num >>> (32 - cnt));
}

/*
 * These functions implement the basic operation for each round of the
 * algorithm.
 */
function cmn(q, a, b, x, s, t)
{
  return add(rol(add(add(a, q), add(x, t)), s), b);
}
function ff(a, b, c, d, x, s, t)
{
  return cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function gg(a, b, c, d, x, s, t)
{
  return cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function hh(a, b, c, d, x, s, t)
{
  return cmn(b ^ c ^ d, a, b, x, s, t);
}
function ii(a, b, c, d, x, s, t)
{
  return cmn(c ^ (b | (~d)), a, b, x, s, t);
}

/*
 * Take a string and return the hex representation of its MD5.
 */
function MD5(str)
{
  x = str2blks_MD5(str);
  var a =  1732584193;
  var b = -271733879;
  var c = -1732584194;
  var d =  271733878;
 
  for(i = 0; i < x.length; i += 16)
  {
    var olda = a;
    var oldb = b;
    var oldc = c;
    var oldd = d;

    a = ff(a, b, c, d, x[i+ 0], 7 , -680876936);
    d = ff(d, a, b, c, x[i+ 1], 12, -389564586);
    c = ff(c, d, a, b, x[i+ 2], 17,  606105819);
    b = ff(b, c, d, a, x[i+ 3], 22, -1044525330);
    a = ff(a, b, c, d, x[i+ 4], 7 , -176418897);
    d = ff(d, a, b, c, x[i+ 5], 12,  1200080426);
    c = ff(c, d, a, b, x[i+ 6], 17, -1473231341);
    b = ff(b, c, d, a, x[i+ 7], 22, -45705983);
    a = ff(a, b, c, d, x[i+ 8], 7 ,  1770035416);
    d = ff(d, a, b, c, x[i+ 9], 12, -1958414417);
    c = ff(c, d, a, b, x[i+10], 17, -42063);
    b = ff(b, c, d, a, x[i+11], 22, -1990404162);
    a = ff(a, b, c, d, x[i+12], 7 ,  1804603682);
    d = ff(d, a, b, c, x[i+13], 12, -40341101);
    c = ff(c, d, a, b, x[i+14], 17, -1502002290);
    b = ff(b, c, d, a, x[i+15], 22,  1236535329);   

    a = gg(a, b, c, d, x[i+ 1], 5 , -165796510);
    d = gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
    c = gg(c, d, a, b, x[i+11], 14,  643717713);
    b = gg(b, c, d, a, x[i+ 0], 20, -373897302);
    a = gg(a, b, c, d, x[i+ 5], 5 , -701558691);
    d = gg(d, a, b, c, x[i+10], 9 ,  38016083);
    c = gg(c, d, a, b, x[i+15], 14, -660478335);
    b = gg(b, c, d, a, x[i+ 4], 20, -405537848);
    a = gg(a, b, c, d, x[i+ 9], 5 ,  568446438);
    d = gg(d, a, b, c, x[i+14], 9 , -1019803690);
    c = gg(c, d, a, b, x[i+ 3], 14, -187363961);
    b = gg(b, c, d, a, x[i+ 8], 20,  1163531501);
    a = gg(a, b, c, d, x[i+13], 5 , -1444681467);
    d = gg(d, a, b, c, x[i+ 2], 9 , -51403784);
    c = gg(c, d, a, b, x[i+ 7], 14,  1735328473);
    b = gg(b, c, d, a, x[i+12], 20, -1926607734);
   
    a = hh(a, b, c, d, x[i+ 5], 4 , -378558);
    d = hh(d, a, b, c, x[i+ 8], 11, -2022574463);
    c = hh(c, d, a, b, x[i+11], 16,  1839030562);
    b = hh(b, c, d, a, x[i+14], 23, -35309556);
    a = hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
    d = hh(d, a, b, c, x[i+ 4], 11,  1272893353);
    c = hh(c, d, a, b, x[i+ 7], 16, -155497632);
    b = hh(b, c, d, a, x[i+10], 23, -1094730640);
    a = hh(a, b, c, d, x[i+13], 4 ,  681279174);
    d = hh(d, a, b, c, x[i+ 0], 11, -358537222);
    c = hh(c, d, a, b, x[i+ 3], 16, -722521979);
    b = hh(b, c, d, a, x[i+ 6], 23,  76029189);
    a = hh(a, b, c, d, x[i+ 9], 4 , -640364487);
    d = hh(d, a, b, c, x[i+12], 11, -421815835);
    c = hh(c, d, a, b, x[i+15], 16,  530742520);
    b = hh(b, c, d, a, x[i+ 2], 23, -995338651);

    a = ii(a, b, c, d, x[i+ 0], 6 , -198630844);
    d = ii(d, a, b, c, x[i+ 7], 10,  1126891415);
    c = ii(c, d, a, b, x[i+14], 15, -1416354905);
    b = ii(b, c, d, a, x[i+ 5], 21, -57434055);
    a = ii(a, b, c, d, x[i+12], 6 ,  1700485571);
    d = ii(d, a, b, c, x[i+ 3], 10, -1894986606);
    c = ii(c, d, a, b, x[i+10], 15, -1051523);
    b = ii(b, c, d, a, x[i+ 1], 21, -2054922799);
    a = ii(a, b, c, d, x[i+ 8], 6 ,  1873313359);
    d = ii(d, a, b, c, x[i+15], 10, -30611744);
    c = ii(c, d, a, b, x[i+ 6], 15, -1560198380);
    b = ii(b, c, d, a, x[i+13], 21,  1309151649);
    a = ii(a, b, c, d, x[i+ 4], 6 , -145523070);
    d = ii(d, a, b, c, x[i+11], 10, -1120210379);
    c = ii(c, d, a, b, x[i+ 2], 15,  718787259);
    b = ii(b, c, d, a, x[i+ 9], 21, -343485551);

    a = add(a, olda);
    b = add(b, oldb);
    c = add(c, oldc);
    d = add(d, oldd);
  }
  return rhex(a) + rhex(b) + rhex(c) + rhex(d);
}

function valid_js() {
   // anything that

-------------
Sincerely
--------------------
http://www.TacPlusPlus.com - PowerFull Scripts For NTTacPlus



Posted By: meteor
Date Posted: 11 June 2004 at 11:42am

Or Some One Convet This Algo Into JS

[code]
<%
Function getSalt(intLen)
' Function takes a given length x and generates a random hex value of x digits.
' Salt can be used to help protect passwords.  When a password is first stored in a
' database generate a salt value also.  Concatenate the salt value with the password,
' and then encrypt it using the HashEncode function below.  Store both the salt value,
' and the encrypted value in the database.  When a password needs to be verified, take
' the password concatenate the salt from the database.  Encode it using the HashEncode
' function below.  If the result matches the the encrypted password stored in the
' database, then it is a match.  If not then the password is invalid.
'
'
' Note: Passwords become case sensitive when using this encryption.
' For more information on Password HASH Encoding, and SALT visit: http://local.15seconds.com/issue/000217.htm - http://local.15seconds.com/issue/000217.htm
'
' Call this function if you wish to generate a random hex value of any given length
'
' Written By: Mark G. Jager
' Written Date: 8/10/2000
'
' Free to distribute as long as code is not modified, and header is kept intact

 Dim strSalt
 Dim intIndex, intRand

 If Not IsNumeric(intLen) Then
  getSalt = "00000000"
  exit function
 ElseIf CInt(intLen) <> CDbl(intLen) Or CInt(intLen) < 1 Then
  getSalt = "00000000"
  exit function
 End If

 Randomize

 For intIndex = 1 to CInt(intLen)
  intRand = CInt(Rnd * 1000) Mod 16
  strSalt = strSalt & getDecHex(intRand)
 Next
 
 getSalt = strSalt

End Function


Function HashEncode(strSecret)
' Function takes an ASCII string less than 2^61 characters long and
' one way hash encrypts it using 160 bit encryption into a 40 digit hex value.
' The encoded hex value cannot be decoded to the original string value.
'
' This is the only function that you need to call for encryption.
'
' Written By: Mark G. Jager
' Written Date: 8/10/2000
'
' Free to distribute as long as code is not modified, and header is kept intact
'
' The author makes no warranties as to the validity, and/or authenticity of this code.
' You may use any code found herein at your own risk.
' This code was written to follow as closely as possible the standards found in
' Federal Information Processing Standards Publication (FIPS PUB 180-1)
' http://csrc.nist.gov/fips/fip180-1.txt - http://csrc.nist.gov/fips/fip180-1.txt -- Secure Hash Standard SHA-1
'
' This code is for private use only, and the security and/or encryption of the resulting
' hexadecimal value is not warrented or gaurenteed in any way.
'
    Dim strEncode, strH(4)
    Dim intPos
   
   
    If len(strSecret) = 0 or len(strSecret) >= 2^61 then
  HashEncode = "0000000000000000000000000000000000000000"
  exit function
    end if
   
   
    'Initial Hex words are used for encoding Digest. 
    'These can be any valid 8-digit hex value (0 to F)
    strH(0) = "FB0C14C2"
    strH(1) = "9F00AB2E"
    strH(2) = "991FFA67"
    strH(3) = "76FA2C3F"
    strH(4) = "ADE426FA"
   
    For intPos = 1 to len(strSecret) step 56
  
  strEncode = Mid(strSecret, intPos, 56) 'get 56 character chunks
  strEncode = WordToBinary(strEncode) 'convert to binary
  strEncode = PadBinary(strEncode) 'make it 512 bites
  strEncode = BlockToHex(strEncode) 'convert to hex value
  
  'Encode the hex value using the previous runs digest
  'If it is the first run then use the initial values above
  strEncode = DigestHex(strEncode, strH(0), strH(1), strH(2), strH(3), strH(4))

  'Combine the old digest with the new digest
  strH(0) = HexAdd(left(strEncode, 8), strH(0))
  strH(1) = HexAdd(mid(strEncode, 9, 8), strH(1))
  strH(2) = HexAdd(mid(strEncode, 17, 8), strH(2))
  strH(3) = HexAdd(mid(strEncode, 25, 8), strH(3))
  strH(4) = HexAdd(right(strEncode, 8), strH(4))
  
    Next
   
    'This is the final Hex Digest
    HashEncode = strH(0) & strH(1) & strH(2) & strH(3) & strH(4)
   
End Function

 

Function HexToBinary(btHex)

' Function Converts a single hex value into it's binary equivalent
'
' Written By: Mark Jager
' Written Date: 8/10/2000
'
' Free to distribute as long as code is not modified, and header is kept intact
'

    Select Case btHex
    Case "0"
        HexToBinary = "0000"
    Case "1"
        HexToBinary = "0001"
    Case "2"
        HexToBinary = "0010"
    Case "3"
        HexToBinary = "0011"
    Case "4"
        HexToBinary = "0100"
    Case "5"
        HexToBinary = "0101"
    Case "6"
        HexToBinary = "0110"
    Case "7"
        HexToBinary = "0111"
    Case "8"
        HexToBinary = "1000"
    Case "9"
        HexToBinary = "1001"
    Case "A"
        HexToBinary = "1010"
    Case "B"
        HexToBinary = "1011"
    Case "C"
        HexToBinary = "1100"
    Case "D"
        HexToBinary = "1101"
    Case "E"
        HexToBinary = "1110"
    Case "F"
        HexToBinary = "1111"
    Case Else
        HexToBinary = "2222"
    End Select
End Function

Function BinaryToHex(strBinary)

' Function Converts a 4 bit binary value into it's hex equivalent
'
' Written By: Mark Jager
' Written Date: 8/10/2000
'
' Free to distribute as long as code is not modified, and header is kept intact
'
    Select Case strBinary
    Case "0000"
        BinaryToHex = "0"
    Case "0001"
        BinaryToHex = "1"
    Case "0010"
        BinaryToHex = "2"
    Case "0011"
        BinaryToHex = "3"
    Case "0100"
        BinaryToHex = "4"
    Case "0101"
        BinaryToHex = "5"
 &

-------------
Sincerely
--------------------
http://www.TacPlusPlus.com - PowerFull Scripts For NTTacPlus



Posted By: dpyers
Date Posted: 11 June 2004 at 12:07pm
http://pajhome.org.uk/crypt/md5/ - http://pajhome.org.uk/crypt/md5/

-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: meteor
Date Posted: 12 June 2004 at 4:09am

Tanx Dpyers For Your Good Link . I use My Last post (VBS) for Client and server side's and now Work Fine. tanx To All Answered MY Q.



-------------
Sincerely
--------------------
http://www.TacPlusPlus.com - PowerFull Scripts For NTTacPlus


Posted By: Bluefrog
Date Posted: 19 June 2004 at 1:37pm

To be perfectly honest, even SSL isn't going to protect people from themselves. Their passwords will still be stolen - keyloggers. I'm going to open up a new anti-keylogger in the near future, but it only works on IE. For complete protection, you need serious solutions. SSL is only a partial solution. Encryption can't protect against keyloggers - which are the most effective way to get passwords, credit card numbers, etc.

I'll post back when the anti-keylogger is available.

 



-------------
http://renegademinds.com/" rel="nofollow - Renegade Minds - Guitar Software http://renegademinds.com/Default.aspx?tabid=65" rel="nofollow - Slow Down Music


Posted By: Mart
Date Posted: 19 June 2004 at 1:47pm

How will it prevent key logging whilst letting people work normally with their PC's?



Posted By: pmormr
Date Posted: 19 June 2004 at 6:18pm
you really can't stop a keylogger... the only way would be to shut down the program (the most practical), except that there is hundreds of keyloggers available each with different process names, the other solution would be to create a complicated hardware encryption device that would be attached to the keyboard and encrypt the keys going in and out of the computer... that would be highly ineffective because i doubt the ms designers would want to build a keyboard decryption protocol into their kernel.

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net