Jump to content

Encryption Help


emery

Recommended Posts

I nee an encryption code for php that will do this, if someone could write it i would be more then happy! :)

 

 

This is how to decode it, if you can figure out ow to encode it that would be awsome :)

 

longstring = "6804564035410064404403402418540676879840602880370546710354657057035406870564064340640810564097523824"

 

 

To decode you peal off the first two digits from C$ and use that to relocate the position of the first digit in the long string. Then take it and the next 7 digits to make B$. Falsely subtract C$ minus B$ and you get the date back in A$.

Link to comment
Share on other sites

This sounds like a school project, or something similar, and as such meant for you to figure out yourself. We won't write your code for you, in any case.

 

Also, you have the step-by-step description of how to do this, all you need to do is to translate it into code. If you cannot do that, then you really need to learn the language.

Link to comment
Share on other sites

Noo, it's for my software, i have the code in quick basic, but i need the code in php, which i don't know much of

 

 

proof:

 

COLOR 15, 1: CLS


'ENCRYPT A$ -> C$

RANDOMIZE TIMER
N$ = "6804564035410064404403402418540676879840602880370546710354657057035406870564064340640810564097523824"
A$ = "20120731"
N = INT(RND(9) * 81 + 10)
PRINT N
B$ = MID$(N$, N, 
C$ = ""
FOR A = 1 TO 8
    X = VAL(MID$(A$, A, 1)) + VAL(MID$(B$, A, 1))
    IF X > 9 THEN X = X - 10
    C$ = C$ + LTRIM$(STR$(X))
NEXT
C$ = LTRIM$(STR$(N)) + C$
PRINT C$

'DECRYPT C$ -> A$


RANDOMIZE TIMER
N$ = "6804564035410064404403402418540676879840602880370546710354657057035406870564064340640810564097523824"
N = VAL(LEFT$(C$, 2))
C$ = RIGHT$(C$, 
B$ = MID$(N$, N, 
A$ = ""
FOR A = 1 TO 8
    X = VAL(MID$(C$, A, 1)) - VAL(MID$(B$, A, 1))
    IF X < 0 THEN X = X + 10
    A$ = A$ + LTRIM$(STR$(X))
NEXT
PRINT A$


Link to comment
Share on other sites

<?php

RANDOMIZE TIMER
$N = "6804564035410064404403402418540676879840602880370546710354657057035406870564064340640810564097523824";
$A = "20120731";
N = INT(RND(9) * 81 + 10);
ECHO N;
$B = MID$(N$, N, ;
$C = "";
FOR A = 1 TO 8
    X = VAL(MID$(A$, A, 1)) + VAL(MID$(B$, A, 1))
    IF (X > 9) {
X = X - 10;
}
    $C = $C . LTRIM$(STR$(X))
NEXT
$C = LTRIM$(STR$(N)) . $C;
echo $c;

?>

 

That is what i have now, but i don't know how to change the rest

Link to comment
Share on other sites

Ok, i have gotten this far, but how do i do the loop for next?

 

<?php

RANDOMIZE TIMER
$N = "6804564035410064404403402418540676879840602880370546710354657057035406870564064340640810564097523824";
$A = "20120731";
N = INTVAL(rand(10, 91);
ECHO N;
$B = SUBSTR(N$, N, ;
$C = "";
FOR A = 1 TO 8
    X = INTVAL(SUBSTR($A, A, 1)) + INTVAL(SUBSTR(B$, A, 1));
    IF (X > 9) {
X = X - 10;
}
    $C = $C . X;
NEXT
$C = N . $C;
echo $c;

?>

Link to comment
Share on other sites

Ok, thank you, this is what i have but it does not work ...

 

 

 

<?php

RANDOMIZE TIMER
$N = "6804564035410064404403402418540676879840602880370546710354657057035406870564064340640810564097523824";
$A = "20120731";
N = INTVAL(rand(10, 91);
ECHO N;
$B = SUBSTR(N$, N, ;
$C = "";
for ($a=1; $a<=8; $a++) {

    X = INTVAL(SUBSTR($A, A, 1)) + INTVAL(SUBSTR(B$, A, 1));
    IF (X > 9) {
X = X - 10;
}
    $C = $C . X;
}
$C = N . $C;
echo $c;

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.