/*
OTP4U 0.8.2 - One Time Pad for you
Copyright (C) 2003 Pierre Blanc
Pierre Blanc: blanc_teutoburgo@yahoo.it
http://www.teutoburgo.tk
http://it.geocities.com/teutoburgo
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or go to http://www.gnu.org/copyleft/gpl.html
*/
package tk.teutoburgo.otp4u.crypt;
import java.io.IOException;
/**
* Mixer constructor comment.
*/
super();
}
public byte[] mix(byte[] publicKey, byte[] ciphertext) {
int pl=publicKey.length, cl=ciphertext.length, n=pl+cl;
byte[] mixed = new byte[n];
for (int i = 0; i < pl ; i++) {
mixed[i]=publicKey[i];
}
for (int i = pl; i < n ; i++) {
mixed[i]=ciphertext[i-pl];
}
return mixed;
}
public byte[] getPublicKey(byte[] mixed, int k4k0Len) {
byte[] publicKey=new byte[k4k0Len*2];
System.
arraycopy(mixed,0,publicKey,0,k4k0Len
*2
);
return publicKey;
}
public byte[] getCiphertext(byte[] mixed, int k4k0Len) {
int cLen=mixed.length-k4k0Len*2;
byte[] ciphertext=new byte[cLen];
System.
arraycopy(mixed,k4k0Len
*2,ciphertext,0,cLen
);
return ciphertext;
}
public static void main
(String args
[]){
}
}