IoT CAS Frameworks/IOT_Server/License_Framework/LicenseKeyGenerator/src/com/prokosha/licensekeygenerator/GA_CreateKeys1.java
static int enc(StringBuffer sznumber, StringBuffer szEnctptd1) {
		int ai, aik, ilen, itemp = 0;
		// int iTotal = 0;
		int itemp1 = 0;

		char szEncoded1[] = { '9', '7', '8', '5', '6', '1', '0', '4', '2', '3',
				'o', 'n', 'k', 'g', 'z', 'p', 'm', 'e', 'l', 's', 't', 'x',
				'q', 'r', 'y', 'b', 'h', 'f', 'a', 'j', 'c', 'i', 'd', 'u',
				'w', 'v' };

		ilen = sznumber.length();

		System.out.println("sznumber is..." + sznumber);

		for (ai = 0; ai <= ilen - 1; ai++) {
			char t = sznumber.charAt(ai);
			aik = (int) t;

			if (Character.isDigit(t)) {
				itemp = (aik - 48) % 10;
				sznumber.setCharAt(ai, szEncoded1[itemp]);
			}
			if (Character.isLetter(t) && Character.isLowerCase(t)) {
				itemp = (aik - 96);

				if (itemp > 0 && itemp < 9) {
					itemp1 = itemp % 10 + 9;
				}
				if (itemp > 9 && itemp < 19) {
					itemp1 = itemp % 10 + 19;
				}
				if (itemp > 19) {
					itemp1 = itemp1 % 10 + 29;
				}
				sznumber.setCharAt(ai, szEncoded1[itemp1]);
			}
			if (Character.isLetter(t) && Character.isUpperCase(t)) {
				itemp = (aik - 64);
				if (itemp > 0 && itemp < 9) {
					itemp1 = itemp % 10 + 9;
				}
				if (itemp > 9 && itemp < 19) {
					itemp1 = itemp % 10 + 19;
				}
				if (itemp > 19) {
					itemp1 = itemp1 % 10 + 29;
				}
				sznumber.setCharAt(ai,
						(Character.toUpperCase(szEncoded1[itemp1])));
			}
		}

		String abc = sznumber.toString();
		System.out.println(" after half of Encrypted key is....." + abc);

		int aln = abc.length();
		char ac;
		for (int ch = 0; ch < aln; ch++) {
			ac = abc.charAt(ch);
			int intik = (int) ac;
			if ((intik <= 47) || (intik >= 91 && intik <= 96)
					|| (intik >= 58 && intik <= 64) || (intik >= 123))
				continue;
			szEnctptd1.setCharAt(ch, ac);
		}

		System.out.println(" Encrypted key is....." + szEnctptd1);
		return (0);
	}
/*
	 * Method enc This method takes String buffer,encrypt and put the result
	 * string in String buffef During encryption it takes each values,
	 * calculates ascii value of each and convert into interger equivalent of
	 * ASCII value
	 */
Method enc This method takes String buffer,encrypt and put the result
string in String buffef During encryption it takes each values,
calculates ascii value of each and convert into interger equivalent of
ASCII value
Method enc This method takes String buffer encrypt and put the result string in String buffef During encryption it takes each values calculates ascii value of each and convert into interger equivalent of ASCII value
static int enc(StringBuffer sznumber, StringBuffer szEnctptd1) {
		int ai, aik, ilen, itemp = 0;
		int itemp1 = 0;
		char szEncoded1[] = { '9', '7', '8', '5', '6', '1', '0', '4', '2', '3',
				'o', 'n', 'k', 'g', 'z', 'p', 'm', 'e', 'l', 's', 't', 'x',
				'q', 'r', 'y', 'b', 'h', 'f', 'a', 'j', 'c', 'i', 'd', 'u',
				'w', 'v' };
		ilen = sznumber.length();
		System.out.println("sznumber is..." + sznumber);
		for (ai = 0; ai <= ilen - 1; ai++) {
			char t = sznumber.charAt(ai);
			aik = (int) t;
			if (Character.isDigit(t)) {
				itemp = (aik - 48) % 10;
				sznumber.setCharAt(ai, szEncoded1[itemp]);
			}
			if (Character.isLetter(t) && Character.isLowerCase(t)) {
				itemp = (aik - 96);
				if (itemp > 0 && itemp < 9) {
					itemp1 = itemp % 10 + 9;
				}
				if (itemp > 9 && itemp < 19) {
					itemp1 = itemp % 10 + 19;
				}
				if (itemp > 19) {
					itemp1 = itemp1 % 10 + 29;
				}
				sznumber.setCharAt(ai, szEncoded1[itemp1]);
			}
			if (Character.isLetter(t) && Character.isUpperCase(t)) {
				itemp = (aik - 64);
				if (itemp > 0 && itemp < 9) {
					itemp1 = itemp % 10 + 9;
				}
				if (itemp > 9 && itemp < 19) {
					itemp1 = itemp % 10 + 19;
				}
				if (itemp > 19) {
					itemp1 = itemp1 % 10 + 29;
				}
				sznumber.setCharAt(ai,
						(Character.toUpperCase(szEncoded1[itemp1])));
			}
		}
		String abc = sznumber.toString();
		System.out.println(" after half of Encrypted key is....." + abc);
		int aln = abc.length();
		char ac;
		for (int ch = 0; ch < aln; ch++) {
			ac = abc.charAt(ch);
			int intik = (int) ac;
			if ((intik <= 47) || (intik >= 91 && intik <= 96)
					|| (intik >= 58 && intik <= 64) || (intik >= 123))
				continue;
			szEnctptd1.setCharAt(ch, ac);
		}
		System.out.println(" Encrypted key is....." + szEnctptd1);
		return (0);
	}
static int enc ( StringBuffer sznumber , StringBuffer szEnctptd1 ) { int ai , aik , ilen , itemp = 0 ; int itemp1 = 0 ; char szEncoded1 [ ] = { '9' , '7' , '8' , '5' , '6' , '1' , '0' , '4' , '2' , '3' , 'o' , 'n' , 'k' , 'g' , 'z' , 'p' , 'm' , 'e' , 'l' , 's' , 't' , 'x' , 'q' , 'r' , 'y' , 'b' , 'h' , 'f' , 'a' , 'j' , 'c' , 'i' , 'd' , 'u' , 'w' , 'v' } ; ilen = sznumber . length ( ) ; System . out . println ( "sznumber is..." + sznumber ) ; for ( ai = 0 ; ai <= ilen - 1 ; ai ++ ) { char t = sznumber . charAt ( ai ) ; aik = ( int ) t ; if ( Character . isDigit ( t ) ) { itemp = ( aik - 48 ) % 10 ; sznumber . setCharAt ( ai , szEncoded1 [ itemp ] ) ; } if ( Character . isLetter ( t ) && Character . isLowerCase ( t ) ) { itemp = ( aik - 96 ) ; if ( itemp > 0 && itemp < 9 ) { itemp1 = itemp % 10 + 9 ; } if ( itemp > 9 && itemp < 19 ) { itemp1 = itemp % 10 + 19 ; } if ( itemp > 19 ) { itemp1 = itemp1 % 10 + 29 ; } sznumber . setCharAt ( ai , szEncoded1 [ itemp1 ] ) ; } if ( Character . isLetter ( t ) && Character . isUpperCase ( t ) ) { itemp = ( aik - 64 ) ; if ( itemp > 0 && itemp < 9 ) { itemp1 = itemp % 10 + 9 ; } if ( itemp > 9 && itemp < 19 ) { itemp1 = itemp % 10 + 19 ; } if ( itemp > 19 ) { itemp1 = itemp1 % 10 + 29 ; } sznumber . setCharAt ( ai , ( Character . toUpperCase ( szEncoded1 [ itemp1 ] ) ) ) ; } } String abc = sznumber . toString ( ) ; System . out . println ( " after half of Encrypted key is....." + abc ) ; int aln = abc . length ( ) ; char ac ; for ( int ch = 0 ; ch < aln ; ch ++ ) { ac = abc . charAt ( ch ) ; int intik = ( int ) ac ; if ( ( intik <= 47 ) || ( intik >= 91 && intik <= 96 ) || ( intik >= 58 && intik <= 64 ) || ( intik >= 123 ) ) continue ; szEnctptd1 . setCharAt ( ch , ac ) ; } System . out . println ( " Encrypted key is....." + szEnctptd1 ) ; return ( 0 ) ; }
Method enc This method takes String buffer,encrypt and put the result
 string in String buffef During encryption it takes each values,
 calculates ascii value of each and convert into interger equivalent of
 ASCII value
Method enc This method takes String buffer encrypt and put the result string in String buffef During encryption it takes each values calculates ascii value of each and convert into interger equivalent of ASCII value
// int iTotal = 0;