implemented encryptedTextKeyChain function in encrypter & decrypter
you can now change the encryption operation in one function
This commit is contained in:
parent
178df23585
commit
e4c5feedb4
@ -109,7 +109,7 @@ outputFlags decryptText(char *text, char *keyNew)
|
||||
//DECRYPT TEXT
|
||||
for (int i = 0; i < textKeyChainLength; i++)
|
||||
{
|
||||
textKeyChain[i] -= encryptedTextKeyChain[i];
|
||||
textKeyChain[i] = encryptionOperation(textKeyChain[i], encryptedTextKeyChain[i]);
|
||||
}
|
||||
|
||||
//FIX (CLEAN) returningText
|
||||
|
@ -90,7 +90,7 @@ outputFlags encryptText(char *text, char *keyNew)
|
||||
//ACTUALLY ENCRYPT TEXT
|
||||
for (int i = 0; i < (int) strlen(text); i++)
|
||||
{
|
||||
textKeyChain[i] -= (int) text[i];
|
||||
textKeyChain[i] = encryptionOperation(textKeyChain[i], (int) text[i]);
|
||||
}
|
||||
|
||||
//COUNT REQUIRED SIZE FOR returningText
|
||||
|
@ -71,4 +71,6 @@ int encryptionOperation(int text, int encryptedText)
|
||||
{
|
||||
//CHANGE THE '-' (MINUS) OPERATOR TO SOMETHING YOU WANT TO USE I GUESS
|
||||
return text - encryptedText;
|
||||
|
||||
//I DO NOT RECOMMEND CHANGING THIS, BUT IF YOU WANT TO, XOR IS A GOOD OPERATOR (IDK IF OTHERS WORK lmao)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user