CyberArmy University | Open Source Institute | CyberArmy Intelligence & Security | CyberArmy Services & Projects

Java - HTML Entities Encr/decr - draft 1


[Replies] [Reply] [View by Thread] [Help]
[Back To SNEAK Development Forum]

Posted by Alpha Cpt FantaSy On 2006-01-03 05:04:05
In Reply to Desktop Version Posted by CinC snarkles On 2005-02-15 17:19:31

Alpha CptAlpha Cpt
Alpha Cpt FantaSy


Please note that all these functions *could* be done using the MonoAlfabCipher class too :)

- ENCRYPTING -
String output = "";
	for (int i=0;i<input.length();i++) {
		output= output + "&#"+String.valueOf((int) (input.charAt(i)))+";";
	}
	return output;
- EOF -

- DECRYPTING -
	int index=0;
	int index2=0;

	while (index2<input.length()-1) {
		index=input.indexOf("&#",index)+2;
		index2=input.indexOf(";",index);
		
		String subString = input.substring(index,index2);
		outputString2=outputString2+(char)(Integer.parseInt(subString));
	}
- EOF -




"You're a hero on level zero."

http://www.virtuax.be



Replies:


Guest:
Subject:
Message:
Signature:
Optional Image Link:
http://

CyberArmy::Forum v0.6
Generated In 0.06829 seconds


About Us | Privacy Policy | Mission Statement | Help