Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Encryption on Post Or get
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Encryption on Post Or get

 Post Reply Post Reply Page  <123>
Author
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post 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.whichssl.com/index.html


Lead me not into temptation... I know the short cut, follow me.
Back to Top
Bluefrog View Drop Down
Senior Member
Senior Member


Joined: 23 October 2002
Location: Korea, South
Status: Offline
Points: 1701
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bluefrog Quote  Post ReplyReply Direct Link To This Post 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.

 

Back to Top
meteor View Drop Down
Groupie
Groupie
Avatar

Joined: 31 August 2003
Location: Iran
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote meteor Quote  Post ReplyReply Direct Link To This Post 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
--------------------
PowerFull Scripts For NTTacPlus
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 11 June 2004 at 11:15am
AFIAK there is not an MD5 hashing function for JS or VBS
Back to Top
meteor View Drop Down
Groupie
Groupie
Avatar

Joined: 31 August 2003
Location: Iran
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote meteor Quote  Post ReplyReply Direct Link To This Post 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 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
--------------------
PowerFull Scripts For NTTacPlus
Back to Top
meteor View Drop Down
Groupie
Groupie
Avatar

Joined: 31 August 2003
Location: Iran
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote meteor Quote  Post ReplyReply Direct Link To This Post 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
'
' 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 -- 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
--------------------
PowerFull Scripts For NTTacPlus
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 11 June 2004 at 12:07pm

Lead me not into temptation... I know the short cut, follow me.
Back to Top
meteor View Drop Down
Groupie
Groupie
Avatar

Joined: 31 August 2003
Location: Iran
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote meteor Quote  Post ReplyReply Direct Link To This Post 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
--------------------
PowerFull Scripts For NTTacPlus
Back to Top
 Post Reply Post Reply Page  <123>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.