256 - 512 bit encryption using 28 digit cipher key
Posted: Wed Mar 25, 2020 3:54 pm
Here is a product that allows you to encode data that can be used in a url. This is really important because you wish customers to send their activation codes without any snoopers.
How is that possible, and how do you avoid this and what about sending text and things that is in another language?
This is relevant but the solution below is a nearly complete method to achieve this.
But this is only half the code, the next portion would rely on php. And this php code is only half finished. The php code is only a detailed description of how to first decode with base 64, string to hex and binary to hex. The reason that these methods are used is for the reason that languages use different ascii codes and representations.
So, earlier someone had suggested that hex, binary and base 64 encoding can be cracked. And of course that is true.
But what the combination of these filters do is ensure that the final product to encoded is only numbers.
There are three passes of real encoding:
When converted to base 64, there's a few letters and a "=" symbol. Using gsub and preg_replace in php that is rewritten to a unique cipher stipulated by the 28 digit cipher you create.
next all numbers 0-9 are encoded to A-J
and the order of this is not fixed, it is based wholly upon the 28 digit cipher.
Next all letters created are converted to numbers, using a different order that is not fixed based upon the 28 digit cipher code which you provide.
Disclaimer: the php code below is only a description to convert hex to binary and to decode binary to a string. It is not the final product and it represents the progress I have made on the php end.
How is that possible, and how do you avoid this and what about sending text and things that is in another language?
This is relevant but the solution below is a nearly complete method to achieve this.
But this is only half the code, the next portion would rely on php. And this php code is only half finished. The php code is only a detailed description of how to first decode with base 64, string to hex and binary to hex. The reason that these methods are used is for the reason that languages use different ascii codes and representations.
So, earlier someone had suggested that hex, binary and base 64 encoding can be cracked. And of course that is true.
But what the combination of these filters do is ensure that the final product to encoded is only numbers.
There are three passes of real encoding:
When converted to base 64, there's a few letters and a "=" symbol. Using gsub and preg_replace in php that is rewritten to a unique cipher stipulated by the 28 digit cipher you create.
next all numbers 0-9 are encoded to A-J
and the order of this is not fixed, it is based wholly upon the 28 digit cipher.
Next all letters created are converted to numbers, using a different order that is not fixed based upon the 28 digit cipher code which you provide.
Disclaimer: the php code below is only a description to convert hex to binary and to decode binary to a string. It is not the final product and it represents the progress I have made on the php end.
- Code: Select all
<?php
function hexToStr($hex)
{
$string='';
for ($i=0; $i < strlen($hex)-1; $i+=2)
{
$string .= chr(hexdec($hex[$i].$hex[$i+1]));
}
return $string;
}
function hexbin($hex) {
$bin = decbin(hexdec($hex));
return $bin;
}
function BinHex($bin) {
$hex='';
for($i=strlen($bin)-4;$i>=0;$i-=4)
$hex.=dechex(bindec(substr($bin,$i,4)));
return strrev($hex);
}
function DeCrypt($str) {
$one = array('`0`is','`1`is','`2`is','`3`is','`4`is','`5`is','`6`is','`7`is','`8`is');
$two = array('A','M','T','E','x','w','D','Q','=');
return preg_replace($one, $two, $str);
}
$codex = "163516341605123512341204123512351634160416351635160516041235
120516341635160512351205120412351634160416051605123416051604
123516351634163412351235163516041235120416341605123512341635
160512041205160416051605123416351604120416051634163516351234
160412051205160516341635163512341604120512051605163416041605
123516351204120512351634163516351235123416041204160416341204
160512351635120412041205163412351635160512351205160416351634
120412351235120516041205160416341204160516351605160416041604
160416041235123416341604120512041604160516051235160416041205
120416341604163512351234160512051605163416351605123512341204
123516051634163516351235123416041205123416041605160512351634
160412041234163412051205163516051604160412041634123516351635
160516041235163416341204160512341635120412051205163416351635
123512341205120412351605163416351605120416051604120416051635
120512041635160412041605163416051635123512341604120416341634
120512351635123516051604120416051635120512051235120412351204
163412051205123512041204123416041604160516051205123512041235
120416341205120512351204120516041204160516351205160512351205
160416351634163516051234163516041235120516341205160512341604
120512341635160416341235163512341204123512041634120512051235
123516051204123516341204160512351234120512041235163412051235
123512051204123512051634160416351635123416041205163416341634
1235123512351788";
$codex = DeCrypt($codex);
//decode base 64
$codex = base64_decode($codex);
// binary to hex
$codex = BinHex($codex);
// hex to string
$codex = hexToStr($codex);
echo $codex;
?>