Here are 4 incode / decode function Plus other function. 3 of them are sime but the last one is my own design. Still an bug that i cannot fix but you might have more luck than me. It work most of the time just now and then the bug happens.
here are the function
SET DISPLAY MODE 800, 600, 16
SET EMULATION ON : sync rate 0 : sync on : Hide mouse
cls 0
Version$ = " 0.007"
ink RGB(255,255,255) , 0
text 5 , 5 , "Page: 1"
center text screen width() / 2 , 5 , "Encryption Functions Version " + Version$
center text screen width() / 2 , 25 , "By Joseph Allen ( ALIEN )"
text 50 , 80 , "Function ASC_TO_BIN() Number: " + str$( asc( "A" ) )
text 50 , 100 , "Result: " + ASC_TO_BIN( ASC( "A" ) )
text 50 , 140 , "Function BIN_TO_ASC() String: 10000001"
text 50 , 160 , "Result: " + str$( BIN_TO_ASC( "10000001" ) )
text 50 , 200 , "Function ASC_Loop() Number: 256"
text 50 , 220 , "Result: " + str$( ASC_Loop( 256 ) )
text 50 , 260 , "Very simple Encryption"
text 50 , 280 , "Function Incode_number_1() String: (Hello World) , Value: +3 "
TEMP_STRING$ = Incode_number_1( "Hello World" , 3 )
text 50 , 300 , "Result: " + TEMP_STRING$
text 50 , 320 , "Function Decode_number_1() String: (" + TEMP_STRING$ + ") , Value: +3 "
text 50 , 340 , "Result: " + Decode_number_1( TEMP_STRING$ , 3 )
Text 50 , 380 , "Password encryption"
text 50 , 400 , "Function Incode_number_2() String: (Hello World) , Password String: (DarkBasic)"
TEMP_STRING$ = Incode_number_2( "Hello World" , "DarkBasic" )
text 50 , 420 , "Result: " + TEMP_STRING$
text 50 , 440 , "Function Decode_number_2() String: (" + TEMP_STRING$ + ") , Password String: (DarkBasic) "
text 50 , 460 , "Result: " + Decode_number_2( TEMP_STRING$ , "DarkBasic" )
center text screen width() / 2 , screen height() - 50 , "Press any key"
sync : suspend for key
cls 0
text 5 , 5 , "Page: 2"
center text screen width() / 2 , 5 , "Encryption Functions Version " + Version$
center text screen width() / 2 , 25 , "By Joseph Allen ( ALIEN )"
text 50 , 80 , "XOR LOGIC"
text 50 , 100 , "Function XOR_logic() String: (11110000) , string 2: (10101010)"
TEMP_STRING$ = XOR_logic( "11110000" , "10101010" )
text 50 , 120 , "Result: " + TEMP_STRING$
text 50 , 160 , "Use one more time to Decode XOR LOGIC"
text 50 , 180 , "Function XOR_logic() String: (" + TEMP_STRING$ + ") , string 2: (10101010)"
text 50 , 200 , "Result: " + XOR_logic( TEMP_STRING$ , "10101010" )
text 50 , 240 , "Function RND_Base_10() Length: 20"
text 50 , 260 , "Result: " + RND_Base_10( 20 )
text 50 , 300 , "Function RND_string() Length: 25"
text 50 , 320 , "Result: " + RND_string( 25 )
text 50 , 360 , "Function RND_Bin() Length: 21"
text 50 , 380 , "Result: " + RND_Bin( 21 )
text 50 , 420 , "Function RND_Misc() string: (0123456789ABCDEF) Length: 30"
text 50 , 440 , "Result: " + RND_Misc( "0123456789ABCDEF" , 30 )
center text screen width() / 2 , screen height() - 50 , "Press any key"
sync : suspend for key
cls 0
text 5 , 5 , "Page: 3"
center text screen width() / 2 , 5 , "Encryption Functions Version " + Version$
center text screen width() / 2 , 25 , "By Joseph Allen ( ALIEN )"
text 50 , 80 , "Bin Invert"
text 50 , 100 , "Function Bin_Invert() String: (Hello World) "
TEMP_STRING$ = Bin_Invert( "Hello World" )
text 50 , 120 , "Result: " + TEMP_STRING$
text 50 , 160 , "Use one more time to Decode Bin Invert"
text 50 , 180 , "Function Bin_Invert() String: (" + TEMP_STRING$ + ")"
text 50 , 200 , "Result: " + Bin_Invert( TEMP_STRING$ )
text 50 , 240 , "Bin Move"
TEMP_STRING$ = "Hello World" : Temp_Password$ = "15476832"
text 50 , 260 , "Function incode_Bin_Move$() String: (" + TEMP_STRING$ + ") Password: (" + Temp_Password$ + ")"
temp_result$ = incode_Bin_Move$( TEMP_STRING$ , Temp_Password$ )
text 50 , 280 , "Result: " + temp_result$
text 50 , 320 , "Decode Bin Move"
text 50 , 340 , "Function Bin_Move$() String: (" + temp_result$ + ") Password: (" + Temp_Password$ + ")"
text 50 , 360 , "Result: " + Decode_Bin_Move$( temp_result$ , Temp_Password$ )
center text screen width() / 2 , screen height() - 50 , "Press any key"
sync : suspend for key
cls 0
text 5 , 5 , "Page: 4"
center text screen width() / 2 , 5 , "Encryption Functions Version " + Version$
center text screen width() / 2 , 25 , "By Joseph Allen ( ALIEN )"
text 50 , 80 , "Convert Number to Hex"
text 50 , 100 , "Function Num_to_Nex$() Number: 201"
temp_result$ = Num_to_Nex$( 201 )
text 50 , 120 , "Result: " + temp_result$
text 50 , 160 , "Convert Hex to number"
text 50 , 180 , "Function Hex_To_Number() String: (" + temp_result$ + ")"
text 50 , 200 , "Result: " + str$( Hex_To_Number( temp_result$ ) )
Dim Number_3_Key( 255 )
GenKey_number_3()
rem print the key
text 50 , 240 , "number 3 encryption key ( function GenKey_number_3() )"
temp_string$ = ""
FOR N = 1 to 100 : temp_string$ = temp_string$ + chr$( Number_3_Key( N ) ) : NEXT N
text 50 , 260 , temp_string$
temp_string$ = ""
FOR N = 101 to 201 : temp_string$ = temp_string$ + chr$( Number_3_Key( N ) ) : NEXT N
text 50 , 280 , temp_string$
temp_string$ = ""
FOR N = 201 to 255 : temp_string$ = temp_string$ + chr$( Number_3_Key( N ) ) : NEXT N
text 50 , 300 , temp_string$
temp_string$ = "Hello to all you Darkbasic programmers"
text 50 , 340 , "incode change letter for another one"
text 50 , 360 , "Function Incode_number_3$() String: (" + temp_string$ + ")"
temp_result$ = Incode_number_3$( temp_string$ )
text 50 , 380 , "Result: " + temp_result$
text 50 , 420 , "Decode change letter for another one"
text 50 , 440 , "Function Decode_number_3$() String: (" + temp_result$ + ")"
text 50 , 460 , "Result: " + Decode_number_3$( temp_result$ )
center text screen width() / 2 , screen height() - 50 , "Press any key"
sync : suspend for key
cls 0
text 5 , 5 , "Page: 5"
center text screen width() / 2 , 5 , "Encryption Functions Version " + Version$
center text screen width() / 2 , 25 , "By Joseph Allen ( ALIEN )"
text 50 , 80 , "Much stronger encryption than the other ones. 2 Key are used. !(16^2)^2"
Dim Number_4_Key(15,15,1)
Dim BackUp_4_key(15,15,1)
Dim Temp_key(15,15,1)
GenKey_number_4()
text 50 , 120 , "Nunber 4 key Gen. function GenKey_number_4()"
FOR X = 0 to 15
FOR Y = 0 to 15
text 50 + ( X * 20 ) , 140 + ( Y * 20 ) , chr$( Number_4_Key(X,Y,0) )
NEXT Y
NEXT X
FOR X = 0 to 15
FOR Y = 0 to 15
text 400 + ( X * 20 ) , 140 + ( Y * 20 ) , chr$( Number_4_Key(X,Y,1) )
NEXT Y
NEXT X
center text screen width() / 2 , screen height() - 50 , "Press any key"
sync : suspend for key
cls 0
text 5 , 5 , "Page: 6"
center text screen width() / 2 , 5 , "Encryption Functions Version " + Version$
center text screen width() / 2 , 25 , "By Joseph Allen ( ALIEN )"
temp_string$ = "Score=9,999,999,999,999,999,999,999,999,999,999,999,999,999"
text 50 , 80 , "incode Number 4"
text 50 , 100 , "Function incode_number_4$() String: (" + temp_string$ + ")"
Timer_1 = TIMER() : temp_result$ = incode_number_4$( temp_string$ ) : Timer_2 = TIMER()
text 50 , 120 , "Result: " + temp_result$
text 50 , 160 , "decode Number 4"
text 50 , 180 , "Function Decode_number_4$() String: (" + temp_result$ + ")"
Timer_3 = TIMER()
text 50 , 200 , "Result: " + Decode_number_4$( temp_result$ )
Timer_4 = TIMER()
text 50 , 240 , "Incode Time: " + str$( Timer_2 - Timer_1 ) + " ms"
text 300 , 240 , "Decode Time: " + str$( Timer_4 - Timer_3 ) + " ms"
text 50 , 280 , "Notes:"
text 80 , 300 , "There is an little bug that happens now and then. The bug is it could miss an letter"
text 80 , 320 , "or an different letter is added to the result."
text 50 , 360 , "incode Number 4 hex ( string input : Hex output )"
text 50 , 380 , "Function incode_number_4_Hex$() String: (" + temp_string$ + ")"
temp_result$ = incode_number_4_Hex$( temp_string$ )
text 50 , 400 , "Result: " + temp_result$
text 50 , 440 , "Decode Number 4 Hex ( hex input : string output )"
text 50 , 460 , "Function Decode_number_4_Hex$() String: (" + temp_result$ + ")"
temp_string$ = Decode_number_4_Hex$( temp_result$ )
text 50 , 480 , "Result: " + temp_string$
center text screen width() / 2 , screen height() - 50 , "Press any key to exit"
sync : suspend for key
end
rem ===========================================================================
rem = Decode number 4 encryption hex input =
rem ===========================================================================
Function Decode_number_4_Hex$( string$ )
return_string$ = ""
FOR X = 0 to 15
FOR Y = 0 to 15
BackUp_4_key(X,Y,0) = Number_4_Key(X,Y,0) : BackUp_4_key(X,Y,1) = Number_4_Key(X,Y,1)
NEXT Y
NEXT X
FOR N = 1 to len( string$ ) step 2
Hex_Left$ = mid$( string$ , N )
Hex_Right$ = mid$( string$ , N + 1 )
chr_val = Hex_To_Number( Hex_Left$ + Hex_Right$ )
Found_letter = 0
chr_Left = 0 : chr_Right = 0
FOR X = 0 to 15
FOR Y = 0 to 15
IF Found_letter = 0 and BackUp_4_key(X,Y,0) = chr_val
Found_letter = 1 : chr_Left = X : chr_Right = Y
endif
NEXT Y
NEXT X
return_chr_Hex$ = Num_to_Nex$( chr_Left ) + Num_to_Nex$( chr_Right )
IF return_chr_Hex$ = "00" then return_chr_Hex$ = "0"
IF Mid$( return_chr_Hex$ , 1 ) = "0" then return_chr_Hex$ = mid$( return_chr_Hex$ , 2 )
return_Chr_value = Hex_To_Number( return_chr_Hex$ )
return_string$ = return_string$ + chr$( return_Chr_value )
rem change key positions
Number_4_Key_Change()
Next N
endfunction return_string$
rem ===========================================================================
rem ===========================================================================
rem = Incode number 4 encryption Hex output =
rem ===========================================================================
Function incode_number_4_Hex$( string$ )
return_string$ = ""
FOR X = 0 to 15
FOR Y = 0 to 15
BackUp_4_key(X,Y,0) = Number_4_Key(X,Y,0) : BackUp_4_key(X,Y,1) = Number_4_Key(X,Y,1)
NEXT Y
NEXT X
FOR N = 1 to len( string$ )
chr_val = asc( mid$( string$ , N ) )
chr_hex$ = Num_to_Nex$( chr_val )
chr_left$ = mid$( chr_hex$ , 1 ) : chr_Right$ = mid$( chr_hex$ , 2 )
Grid_X = Hex_To_Number( chr_left$ ) : Grid_Y = Hex_To_Number( chr_Right$ )
temp_Hex_Num$ = Num_to_Nex$( BackUp_4_key( Grid_X , Grid_Y , 0 ) )
IF LEN( temp_Hex_Num$ ) = 1 then temp_Hex_Num$ = "0" + temp_Hex_Num$
return_string$ = return_string$ + temp_Hex_Num$
rem change key positions
Number_4_Key_Change()
NEXT N
endfunction return_string$
rem ===========================================================================
rem ===========================================================================
rem = change the key for encryption number 4 =
rem ===========================================================================
Function Number_4_Key_Change()
For X = 0 to 15
FOR Y = 0 to 15
Temp_key(X,Y,0) = BackUp_4_key(X,Y,0)
Temp_key(X,Y,1) = BackUp_4_key(X,Y,1)
NEXT Y
NEXT X
For X = 0 to 15
FOR Y = 0 to 15
Chr_Hex$ = Num_to_Nex$( Temp_key(X,Y,1) )
IF LEN( Chr_Hex$ ) = 1 then Chr_Hex$ = "0" + Chr_Hex$
grid_X = Hex_To_Number( mid$( Chr_Hex$ , 1 ) )
Grid_Y = Hex_To_Number( mid$( Chr_Hex$ , 2 ) )
BackUp_4_key( grid_X , Grid_Y , 0 ) = Temp_key(X,Y,0)
NEXT Y
NEXT X
endfunction
rem ===========================================================================
rem ===========================================================================
rem = Makes an key for number 4 encryption =
rem ===========================================================================
Function GenKey_number_4()
FOR X = 0 to 15
FOR Y = 0 to 15
Number_4_Key(X,Y,0) = -1 : Number_4_Key(X,Y,1) = -1
NEXT Y
NEXT X
rem part 1
Dim Temp_Value(255)
FOR N = 0 to 255 : Temp_Value(N) = N : NEXT N
RND_Count = TIMER() : RANDOMIZE RND_Count
FOR X = 0 to 15
FOR Y = 0 to 15
check_Loop:
RND_Count = RND_Count + 1
RANDOMIZE RND_Count
TEMP_number = RND(255)
IF Temp_Value( TEMP_number ) >= 0
Number_4_Key(X,Y,0) = Temp_Value( TEMP_number )
Temp_Value( TEMP_number ) = -1
else
goto check_Loop
endif
NEXT Y
NEXT X
rem part 2
Dim Temp_Value(255)
FOR N = 0 to 255 : Temp_Value(N) = N : NEXT N
FOR X = 0 to 15
FOR Y = 0 to 15
check_Loop_2:
RND_Count = RND_Count + 2
RANDOMIZE RND_Count
TEMP_number = RND(255)
IF Temp_Value( TEMP_number ) >= 0
Number_4_Key(X,Y,1) = Temp_Value( TEMP_number )
Temp_Value( TEMP_number ) = -1
else
goto check_Loop_2
endif
NEXT Y
NEXT X
endfunction
rem ===========================================================================
rem ===========================================================================
rem = Incode number 4 encryption =
rem ===========================================================================
Function incode_number_4$( string$ )
return_string$ = ""
FOR X = 0 to 15
FOR Y = 0 to 15
BackUp_4_key(X,Y,0) = Number_4_Key(X,Y,0) : BackUp_4_key(X,Y,1) = Number_4_Key(X,Y,1)
NEXT Y
NEXT X
FOR N = 1 to len( string$ )
chr_val = asc( mid$( string$ , N ) )
chr_hex$ = Num_to_Nex$( chr_val )
chr_left$ = mid$( chr_hex$ , 1 ) : chr_Right$ = mid$( chr_hex$ , 2 )
Grid_X = Hex_To_Number( chr_left$ ) : Grid_Y = Hex_To_Number( chr_Right$ )
return_string$ = return_string$ + chr$( BackUp_4_key( Grid_X , Grid_Y , 0 ) )
rem change key positions
Number_4_Key_Change()
NEXT N
endfunction return_string$
rem ===========================================================================
rem ===========================================================================
rem = Decode number 4 encryption =
rem ===========================================================================
Function Decode_number_4$( string$ )
return_string$ = ""
FOR X = 0 to 15
FOR Y = 0 to 15
BackUp_4_key(X,Y,0) = Number_4_Key(X,Y,0) : BackUp_4_key(X,Y,1) = Number_4_Key(X,Y,1)
NEXT Y
NEXT X
FOR N = 1 to len( string$ )
chr_val = asc( mid$( string$ , N ) )
Found_letter = 0
chr_Left = 0 : chr_Right = 0
FOR X = 0 to 15
FOR Y = 0 to 15
IF Found_letter = 0 and BackUp_4_key(X,Y,0) = chr_val
Found_letter = 1 : chr_Left = X : chr_Right = Y
endif
NEXT Y
NEXT X
return_chr_Hex$ = Num_to_Nex$( chr_Left ) + Num_to_Nex$( chr_Right )
return_Chr_value = Hex_To_Number( return_chr_Hex$ )
return_string$ = return_string$ + chr$( return_Chr_value )
rem change key positions
Number_4_Key_Change()
Next N
endfunction return_string$
rem ===========================================================================
rem ===========================================================================
rem = Makes an key for number 3 encryption =
rem ===========================================================================
Function GenKey_number_3()
Dim Temp_Value(255)
FOR N = 1 to 255 : Temp_Value(N) = N : NEXT N
RND_Count = TIMER() : RANDOMIZE RND_Count
FOR N = 1 to 255
check_Loop:
RND_Count = RND_Count + 1
RANDOMIZE RND_Count
TEMP_number = RND(255)
IF Temp_Value( TEMP_number ) > 0
Number_3_Key( N ) = Temp_Value( TEMP_number ) : Temp_Value( TEMP_number ) = 0
else
goto check_Loop
endif
NEXT N
endfunction
rem ===========================================================================
rem ===========================================================================
rem = change letter for another one =
rem ===========================================================================
Function Incode_number_3$( string$ )
return_string$ = ""
FOR N = 1 to LEN( string$ )
Temp_Value = asc( Mid$( string$ , N ) )
return_string$ = return_string$ + chr$( Number_3_Key( Temp_Value ) )
NEXT N
endfunction return_string$
rem ===========================================================================
rem ===========================================================================
rem = change letter for another one =
rem ===========================================================================
Function Decode_number_3$( string$ )
return_string$ = ""
FOR N = 1 to LEN( string$ )
Temp_Value = asc( Mid$( string$ , N ) )
Found_letter = 0
FOR Q = 1 to 255
IF Found_letter = 0 and Number_3_Key( Q ) = Temp_Value
Found_letter = 1
return_string$ = return_string$ + chr$( Q )
endif
NEXT Q
NEXT N
endfunction return_string$
rem ===========================================================================
rem ===========================================================================
rem = Hex to number =
rem ===========================================================================
Function Hex_To_Number( string$ )
Return_Vaue = 0 : Found_Hex = 0 : TEMP_number = 0
repeat
IF Hex$( TEMP_number ) = string$ then Found_Hex = 1 : Return_Vaue = TEMP_number
TEMP_number = TEMP_number + 1
IF TEMP_number > 256 then Found_Hex = 1
until Found_Hex = 1
endfunction Return_Vaue
rem ===========================================================================
rem ===========================================================================
rem = Number to Hex =
rem ===========================================================================
Function Num_to_Nex$( number )
Return_String$ = hex$( number )
endfunction Return_String$
rem ===========================================================================
rem ===========================================================================
rem = Decode Bin Move =
rem ===========================================================================
Function Decode_Bin_Move$( string$ , Password$ )
Return_String$ = ""
IF LEN( Password$ ) = 8
FOR N = 1 to len( string$ )
Temp_Chr$ = MID$( string$ , N )
Temp_chr_Bin$ = ASC_TO_BIN( asc( Temp_Chr$ ) )
DIM TEMP_BIN(8)
FOR D = 1 to 8
TEMP_BIN(8) = 0
NEXT D
FOR Q = 1 to 8
temp_num$ = mid$( Password$ , Q )
temp_Bin$ = mid$( Temp_chr_Bin$ , Q )
TEMP_BIN( val(temp_num$) ) = val( temp_Bin$ )
NEXT Q
output_Bin$ = ""
FOR S = 1 to 8
output_Bin$ = output_Bin$ + str$( TEMP_BIN( S ) )
NEXT S
Return_String$ = Return_String$ + chr$( BIN_TO_ASC( output_Bin$ ) )
NEXT N
endif
endfunction Return_String$
rem ===========================================================================
rem ===========================================================================
rem = incode Bin Move =
rem ===========================================================================
Function incode_Bin_Move$( string$ , Password$ )
Return_String$ = ""
IF LEN( Password$ ) = 8
FOR N = 1 to len( string$ )
Temp_Chr$ = MID$( string$ , N )
Temp_chr_Bin$ = ASC_TO_BIN( asc( Temp_Chr$ ) )
output_Bin$ = ""
FOR Q = 1 to 8
temp_num$ = mid$( Password$ , Q )
temp_Bin$ = mid$( Temp_chr_Bin$ , val( temp_num$ ) )
output_Bin$ = output_Bin$ + temp_Bin$
NEXT Q
Return_String$ = Return_String$ + chr$( BIN_TO_ASC( output_Bin$ ) )
NEXT N
endif
endfunction Return_String$
rem ===========================================================================
rem ===========================================================================
rem = Bin invert =
rem ===========================================================================
Function Bin_Invert( string$ )
Return_String$ = ""
FOR N = 1 to len( string$ )
Temp_Chr$ = mid$( string$ , N )
Temp_Bin$ = ASC_TO_BIN( asc( Temp_Chr$ ) )
TEMP_Bin2$ = ""
FOR X = 1 to LEN( Temp_Bin$ )
IF mid$( Temp_Bin$ , X ) = "1" then TEMP_Bin2$ = TEMP_Bin2$ + "0"
IF mid$( Temp_Bin$ , X ) = "0" then TEMP_Bin2$ = TEMP_Bin2$ + "1"
NEXT X
Return_String$ = Return_String$ + chr$( BIN_TO_ASC( TEMP_Bin2$ ) )
NEXT N
endfunction Return_String$
rem ===========================================================================
rem ===========================================================================
rem = RND misc =
rem ===========================================================================
Function RND_Misc( String$ , Length )
Return_String$ = ""
RND_Count = TIMER()
RANDOMIZE RND_Count
FOR N = 1 to Length
Return_Chr$ = Mid$( String$ , RND( LEN( String$ ) - 1 ) + 1 )
Return_String$ = Return_String$ + Return_Chr$
RND_Count = RND_Count + 1
RANDOMIZE RND_Count
NEXT N
endfunction Return_String$
rem ===========================================================================
rem ===========================================================================
rem = RND BIN =
rem ===========================================================================
Function RND_Bin( Length )
Return_String$ = ""
RND_Count = TIMER()
RANDOMIZE RND_Count
FOR N = 1 to Length
Return_String$ = Return_String$ + str$( rnd(1) )
RND_Count = RND_Count + 1
RANDOMIZE RND_Count
NEXT N
endfunction Return_String$
rem ===========================================================================
rem = RND String =
rem ===========================================================================
Function RND_string( Length )
Return_String$ = ""
RND_Count = TIMER()
RANDOMIZE RND_Count
FOR N = 1 to Length
Return_String$ = Return_String$ + chr$( RND(255) )
RND_Count = RND_Count + 1
RANDOMIZE RND_Count
NEXT N
endfunction Return_String$
rem ===========================================================================
rem ===========================================================================
rem = RND basic 10 =
rem ===========================================================================
Function RND_Base_10( Length )
Return_String$ = ""
RND_Count = TIMER()
RANDOMIZE RND_Count
FOR N = 1 to Length
Return_String$ = Return_String$ + str$( RND(9) )
RND_Count = RND_Count + 1
RANDOMIZE RND_Count
NEXT N
endfunction Return_String$
rem ===========================================================================
rem ===========================================================================
rem = XOR logic =
rem ===========================================================================
Function XOR_logic( string$ , String2$ )
Return_String$ = ""
IF LEN( string$ ) = LEN( String2$ )
FOR N = 1 to LEN( string$ )
Return_String$ = Return_String$ + "0"
IF MID$( string$ , N ) = "0" and MID$( string2$ , N ) = "0"
Return_String$ = Left$( Return_String$ , LEN( Return_String$ ) - 1 )
Return_String$ = Return_String$ + "1"
endif
IF MID$( string$ , N ) = "1" and MID$( string2$ , N ) = "1"
Return_String$ = Left$( Return_String$ , LEN( Return_String$ ) - 1 )
Return_String$ = Return_String$ + "1"
endif
NEXT N
endif
endfunction Return_String$
rem ===========================================================================
rem ===========================================================================
rem = Password encryption =
rem ===========================================================================
Function Incode_number_2( string$ , Password$ )
Return_String$ = ""
PassWord_Count = 1
FOR N = 1 to len( string$ )
Temp_value = asc( MID$( String$ , N ) )
Temp_Pas_Value = asc( MID$( Password$ , PassWord_Count ) )
Return_String$ = Return_String$ + chr$( ASC_Loop( TEMP_Value + Temp_Pas_Value ) )
PassWord_Count = PassWord_Count + 1
IF PassWord_Count > LEN( Password$ ) then PassWord_Count = 1
NEXT N
endfunction Return_String$
Function Decode_number_2( string$ , Password$ )
Return_String$ = ""
PassWord_Count = 1
FOR N = 1 to len( string$ )
Temp_value = asc( MID$( String$ , N ) )
Temp_Pas_Value = asc( MID$( Password$ , PassWord_Count ) )
Return_String$ = Return_String$ + chr$( ASC_Loop( TEMP_Value - Temp_Pas_Value ) )
PassWord_Count = PassWord_Count + 1
IF PassWord_Count > LEN( Password$ ) then PassWord_Count = 1
NEXT N
endfunction Return_String$
rem ===========================================================================
rem ===========================================================================
rem = simple incode =
rem ===========================================================================
Function Incode_number_1( String$ , Number )
Return_String$ = ""
FOR N = 1 to LEN( String$ )
TEMP_Value = asc( MID$( String$ , N ) )
Return_String$ = Return_String$ + chr$( ASC_loop( TEMP_Value + Number ) )
NEXT N
endfunction Return_String$
Function Decode_number_1( String$ , Number )
Return_String$ = ""
FOR N = 1 to LEN( String$ )
TEMP_Value = asc( MID$( String$ , N ) )
Return_String$ = Return_String$ + chr$( ASC_loop( TEMP_Value - Number ) )
NEXT N
endfunction Return_String$
rem ===========================================================================
rem ===========================================================================
rem = ASC wrap =
rem ===========================================================================
Function ASC_Loop( Number )
Return_Value = Number
IF Return_Value < 0 then Return_Value = Return_Value + 255
IF Return_Value > 255 then Return_Value = Return_Value - 255
endfunction Return_Value
rem ===========================================================================
rem ===========================================================================
rem = Convert Bin to asc value =
rem ===========================================================================
Function BIN_TO_ASC( string$ )
Return_Value = 0
IF MID$( string$ , 1 ) = "1" then Return_Value = Return_Value + 128
IF MID$( string$ , 2 ) = "1" then Return_Value = Return_Value + 64
IF MID$( string$ , 3 ) = "1" then Return_Value = Return_Value + 32
IF MID$( string$ , 4 ) = "1" then Return_Value = Return_Value + 16
IF MID$( string$ , 5 ) = "1" then Return_Value = Return_Value + 8
IF MID$( string$ , 6 ) = "1" then Return_Value = Return_Value + 4
IF MID$( string$ , 7 ) = "1" then Return_Value = Return_Value + 2
IF MID$( string$ , 8 ) = "1" then Return_Value = Return_Value + 1
endfunction Return_Value
rem ===========================================================================
rem ===========================================================================
rem = Convert asc to Bin =
rem ===========================================================================
Function ASC_TO_BIN( Number )
Return_String$ = ""
IF Number >= 128 : Return_String$ = Return_String$ + "1" : Number = Number - 128 : else : Return_String$ = Return_String$ + "0" : endif
IF Number >= 64 : Return_String$ = Return_String$ + "1" : Number = Number - 64 : else : Return_String$ = Return_String$ + "0" : endif
IF Number >= 32 : Return_String$ = Return_String$ + "1" : Number = Number - 32 : else : Return_String$ = Return_String$ + "0" : endif
IF Number >= 16 : Return_String$ = Return_String$ + "1" : Number = Number - 16 : else : Return_String$ = Return_String$ + "0" : endif
IF Number >= 8 : Return_String$ = Return_String$ + "1" : Number = Number - 8 : else : Return_String$ = Return_String$ + "0" : endif
IF Number >= 4 : Return_String$ = Return_String$ + "1" : Number = Number - 4 : else : Return_String$ = Return_String$ + "0" : endif
IF Number >= 2 : Return_String$ = Return_String$ + "1" : Number = Number - 2 : else : Return_String$ = Return_String$ + "0" : endif
IF Number >= 1 : Return_String$ = Return_String$ + "1" : Number = Number - 1 : else : Return_String$ = Return_String$ + "0" : endif
endfunction Return_String$
rem ===========================================================================