All pastes #90022 Raw Edit

Unnamed

public text v1 · immutable
#90022 ·published 2006-07-17 07:22 UTC
rendered paste body
		public byte[] encrypt(String plaintext) {
			try {
				byte[] ciphertext = e.doFinal(plaintext.getBytes("UTF-8"));
				return ciphertext;
			} catch (Exception e) {
				e.printStackTrace();
			}
			return null;
		}
	
		public String decrypt(byte[] ciphertext) {
			try {
				byte[] plaintext = d.doFinal(ciphertext);
				return new String(plaintext, "UTF-8");
			} catch (Exception e) {
				e.printStackTrace();
			}
			return null;
		}