| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Hello Gaston,
Hi, (sorry for my english, im from ARgentine :( )
Your english is fine!
i dont have a good understanding of cryptography or cipher...i
That's not the problem - it's much more fundamental...
Here is my code and my console output. Like you see, my input and output are padded... what am i doing wrong!!??
--- 8< 8< 8< ---
byte[] input = "HOLA MMMMMMUNDO".getBytes();
--- 8< 8< 8< ---
byte[] output = new byte[cpt.length - unpad];
--- 8< 8< 8< ---
System.out.println("TEST " + input + " -- " + output);
That's as expected. The out you are seeing is '[' to indicate you're printing an array. 'B' to indicate it's a byte-array, and "@?????" to indicate the address in memory of the byte-array. The "problem" is that Java does not do "auto-formatting" of byte-arrays - so that System.out.println( byteArray ); does not produce the string you expect. Instead, either do this:TEST [B@74c3aa -- [B@1d9fd51
System.out.println( new String(input) );
or print it manually:
for ( int i = 0; i < input.length; i++ )
{
System.out.print( input[ i ] );
} // for
System.out.println();
Try that,
Martin Egholm
_______________________________________________
gnu-crypto-discuss mailing list
gnu-crypto-discuss@xxxxxxx
http://lists.gnu.org/mailman/listinfo/gnu-crypto-discuss
[Home] [Gnu Classpath] [Linux Kernel] [Linux Cryptography] [Fedora] [Fedora Directory] [Red Hat Development] [Red Hat 9 Bible] [Fedora Bible] [Red Hat 9] [Network Security Reading]
![]() |