MaGiCaLB has asked for the wisdom of the Perl Monks concerning the following question:
There is no issue in the Twofish part. My issue is the byte arrays that are being called. I need to rewrite them to perl, but I am stuck at this part:iMode = 0; String key = "1234567890"; byte[] bytes = new byte[256]; byte[] kbytes = key.getBytes(); for (int i = 0; i < bytes.length; i++) { if (i < kbytes.length) { bytes[i] = kbytes[i]; } else { bytes[i] = (byte) i; } } byte[] md5digest = md5DigestAsBytes(bytes); try { theGeneratedKey = Twofish_Algorithm.makeKey(md5digest); blockSize = Twofish_Algorithm.blockSize();
how do you create a new 256 byte array in perl. The objective, to decrypt and encrypt data between Java and Perl.byte[] bytes = new byte[256];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Java to perl conversion
by BrowserUk (Patriarch) on May 31, 2013 at 09:59 UTC | |
|
Re: Java to perl conversion
by RichardK (Parson) on May 31, 2013 at 10:04 UTC | |
|
Re: Java to perl conversion
by Anonymous Monk on May 31, 2013 at 09:10 UTC | |
by MaGiCaLB (Initiate) on May 31, 2013 at 09:33 UTC | |
by Corion (Patriarch) on May 31, 2013 at 09:35 UTC | |
by Anonymous Monk on May 31, 2013 at 09:48 UTC | |
by MaGiCaLB (Initiate) on May 31, 2013 at 10:16 UTC | |
by Anonymous Monk on May 31, 2013 at 10:31 UTC | |
|
Re: Java to perl conversion
by MaGiCaLB (Initiate) on May 31, 2013 at 10:22 UTC | |
by BrowserUk (Patriarch) on May 31, 2013 at 10:37 UTC |