Jump to content
YOUR-AD-HERE
HOSTING
TOOLS

Locked Algoritmo de Encryptacion de String


Expermicid

Recommended Posts

Para practicar un poco java, traslade este algoritmo de encryptacion de string.

 

Encryptacion:

 

[lenguaje=java]private static String Encryptar(String sText, String sPass) {

 

int x;

int aux = 0;

int iPass = 0;

String result;

 

result = "";

 

for (x=0;x

iPass = iPass + ((int)sPass.charAt(x));

}

for (x=0;x

aux = (int)sText.charAt(x) + iPass + x;

while (aux > 255) {

aux = aux - 255;

}

result = result + (char)aux;

}

return result;

 

}[/lenguaje]

 

Desencryptacion:

 

[lenguaje=java]private static String Desencryptar(String sText, String sPass) {

 

int x;

int aux = 0;

int iPass = 0;

String result;

 

result = "";

 

for (x=0;x

iPass = iPass + ((int)sPass.charAt(x));

}

for (x=0;x

aux = (int)sText.charAt(x) - iPass - x;

while (aux < 0) {

aux = aux + 255;

}

result = result + (char)aux;

}

return result;

 

}[/lenguaje]

 

En funcionamiento

 

This is the hidden content, please

 

Saludos

Edited by Expermicid
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.