Using...

Started on the old forum in November 2007 · view the original in the archive · old links redirect here

1 reply · 600 views · started 19 years ago · 1 min read

Guest #1

how this encryption works? it can be generated with php or not? it is stronger then md5, sha1 using 120bit encryption, md5 32, so im wondering, it can be generated with php? External image (may be gone) or maybe sha256?

Edit:

ok. i found this script

<?php 

function encryptData($string,$type) { 
        if($type == 'SHA256') // See if they have selected to use SHA256 encryption. 
                { 
                        // Use MHash to encrypt the string with SHA256. 
                        $encryptedstring = bin2hex(mhash(MHASH_SHA256,$string)); 
                        echo $encryptedstring; 
                } 
                else 
                { 
                        if($type == 'SHA1') // See if they have selected to use SHA1 encryption. 
                                { 
                                        // Encrypt the string with md5, sha1 and base64 
                                        $encryptedstring = sha1(base64_encode($string)); 
                                        echo $encryptedstring; 
                                } 
                                else 
                                { 
                                        if($type == 'MD5') // See if they have selected to use MD5 encrpytion. 
                                                { 
                                                        // Encrypt with md5 and base64. 
                                                        $encryptedstring = md5(base64_encode($string)); 
                                                        echo $encryptedstring; 
                                                } 
                                                else 
                                                { 
                                                        // If the $type variable is incorrect echo an error. 
                                                        echo 'You have not specified a valid encryption method.  Those available are SHA256, SHA1 and MD5, note the capitals, they are required.'; 
                                                } 
                                } 
                } 
} 
?>

so i got some idea, we can create a encryption service script External image (may be gone) example,

Text to encrypt:
<input name="string" type="text" maxlength="50" emptyok="true"/>

Select Hash:

<select>
  <option value="md5">MD5</option>
  <option value="sha1">SHA1</option>
  <option value="sha256">SHA256</option>
 </select>
<anchor>Encypt
<go method="post" href="encryptor.php">

<postfield name="string" value="$(string)"/>
<postfield name="type" value="$(type)"/>

</go>
</anchor>

where the encryptor.php is script with encrypt function...

this is just an example, i'll try to make one... External image (may be gone) and i think that this is good service script External image (may be gone)

Guest #2

here is the encrypt script...

<?php
header("Content-type: text/vnd.wap.wml");
print '<?xml version="1.0" encoding="UTF-8"?>';
print '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.dtd">';
##################################################
if(isset($_GET['go']) && $_GET['go'] == 'encrypt')
   {
?>

<wml>
<card id="result" title="SHA256 Encryptor - Result">
<p align="center">
[size="1"]

<?
$sha256 = bin2hex(mhash(MHASH_SHA256,$string));
$sha1 = sha1(base64_encode($string));
$md5 = md5(base64_encode($string));
?>

Encrypted String 

<small>
SHA256:

[b]<?print("$sha256")?>[/b]

SHA1:

[b]<?print("$sha1")?>[/b]

MD5:

[b]<?print("$md5")?>[/b]

[/size]
[url="<?$PHP_SELF;?>?"]Back[/url]

</small>
</p>
</card>
</wml>
<?php
      exit;
}
?>

<wml>
<card id="index"  title="SHA256 Encryptor">

<p align="center">

[size="1"]
Hash Encryptor, Encrypt Passwords, Words, Etc...

[b]String To Encrypt:[/b]
[/size]

<input name="string" type="text" maxlength="50" emptyok="true"/>

<anchor>[size="1"]Encrypt[/size]
<go method="post" href="<?$PHP_SELF?>?go=encrypt&string=$(string)">

<postfield name="string" value="$(string)"/>

</go>
</anchor>

</p>

</card>
</wml>

External image (may be gone)

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close