Database Reference
In-Depth Information
(int)lII1l[I1ll1.length()/IlIl1] ^
(int)ll1I1[( I1ll1.length()/IlIl1 ) %
ll1I1.length] );
if( ll11I.length() == ( IlIl1/IlIl1 ) )
I1ll1 += "0";
I1ll1 += ll11I;
if( ( ( I1ll1.length()/IlIl1 ) % lII1l.length )
== ( IlIl1 - IlIl1 ) )
{
System.arraycopy( ll1I1, IlIl1 - IlIl1,
lII1l, IlIl1 * 0, IlIl1/IlIl1 );
break I11lI;
}
} while( true );
return I1ll1;
}
static byte[] lI1ll( String I1ll1 ) {
int IlIl1 = 0;
if( I1ll1 == null )
I1ll1 = OracleJavaSecure.l;
byte[] lII1l = new byte[I1ll1.length()];
do lII1l[IlIl1] = (byte)(I1ll1.charAt(IlIl1++));
while( IlIl1 < lII1l.length );
return lII1l;
}
Generating an Encoded APPVER Connection String
We will add code to the main() method of OracleJavaSecure , as shown in Listing 11-8, to accept the
password for appver as a command line argument and encrypt a connection string for appver . We check
the format of the argument to see if it is possibly a two-factor authentication code. If it's not, then we call
the obfuscated code in OJSC to do encryption and decryption for display. This uses the additional appver
connection string attributes defined here.
Listing 11-8. Utility Encoding of appver Password and Connection String
if( args.length != 0 && args[0] != null ) {
String encodeThis = args[0];
if( ! encodeThis.equals( checkFormat2Factor (encodeThis)) ) {
encodeThis = "jdbc:oracle:thin:appver/" + encodeThis +
"@localhost:1521:orcl" ;
//"@localhost:1521:apver"; // for use later in Chapter 11
String encoded = OJSC.x( encodeThis );
System.out.println( encoded );
encodeThis = OJSC.y( encoded );
System.out.println( encodeThis );
}
} else System.out.println(
 
Search WWH ::




Custom Search