- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
<?php
function qes2_key ( $key = null ) {
$key = str_split( $key );
$keycount = count( $key );
$xspos = 1;
$summ = 0;
foreach( $key as $letter ) {
$summ += ord( $letter ) * 2 + $xspos + ( $keycount / $xspos );
$xspos++;
}
$summ = explode('.', $summ );
return $summ[0];
}
function qes2_encrypt ( $input, $key ) {
$input = str_split( $input );
$icount = count( $input );
$rsumm = qes2_key( $key );
$result = '';
$xspos = 1;
$xsdisp = 1;
foreach( $input as $letter ) {
$char = ord( $letter ) + ( $rsumm * $xspos ) - $xsdisp ;
$result .= chr( $char );
$xspos++;
$xsdisp += 1;
}
return $result;
}
function qes2_decrypt ( $input, $key ) {
$input = str_split( $input );
$icount = count( $input );
$rsumm = qes2_key( $key );
$result = '';
$xspos = 1;
$xsdisp = 1;
foreach( $input as $letter ) {
$char = ord( $letter ) - ( $rsumm * $xspos ) + $xsdisp ;
$result .= chr( $char );
$xspos++;
$xsdisp += 1;
}
return $result;
}
guest8 27.04.2020 18:16 # −999
bormand 27.04.2020 20:53 # 0
BECEHHuu_nemyx 27.04.2020 22:10 # 0
guest8 27.04.2020 20:55 # −999