Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

moved files #18

Merged
merged 1 commit into from
Jun 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions java/src/main/java/com/google/k2crypto/BuilderException.java

This file was deleted.

52 changes: 0 additions & 52 deletions java/src/main/java/com/google/k2crypto/DecryptionException.java

This file was deleted.

50 changes: 0 additions & 50 deletions java/src/main/java/com/google/k2crypto/EncryptionException.java

This file was deleted.

30 changes: 0 additions & 30 deletions java/src/main/java/com/google/k2crypto/KeyVersion.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
*
* @author John Maheswaran ([email protected])
*/
public abstract class Purpose {
public abstract class Operation {

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,23 @@

package com.google.k2crypto;

import java.io.IOException;
import com.google.k2crypto.exceptions.DecryptionException;
import com.google.k2crypto.exceptions.EncryptionException;
import com.google.k2crypto.keyversions.SymmetricKeyVersion;

import java.io.InputStream;
import java.io.OutputStream;

import javax.crypto.BadPaddingException;
import javax.crypto.CipherInputStream;
import javax.crypto.CipherOutputStream;
import javax.crypto.IllegalBlockSizeException;

/**
* This class represents a symmetric encryption in a K2. It is extends Purpose and allows you to
* actually encrypt and decrypt data using a SymmetricKey
*
* @author John Maheswaran ([email protected])
*/
public class SymmetricEncryption extends Purpose {
public class SymmetricEncryption extends Operation {

/**
* Encrypts a byte array using a symmetric key version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,13 @@

package com.google.k2crypto.keyversions;

import com.google.k2crypto.BuilderException;
import com.google.k2crypto.DecryptionException;
import com.google.k2crypto.EncryptionException;
import com.google.k2crypto.KeyVersionBuilder;
import com.google.k2crypto.SymmetricKeyVersion;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import com.google.k2crypto.exceptions.BuilderException;

import java.security.SecureRandom;

import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.CipherInputStream;
import javax.crypto.CipherOutputStream;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.KeyGenerator;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
Expand Down Expand Up @@ -115,11 +101,6 @@ private int keyLengthInBits() {
*/
private Cipher decryptingCipher;

/**
* Byte array used to buffer data when encrypting or decrypting streams
*/
private byte[] byteBuffer = new byte[1024];

/**
* Initializes the key using key matter and initialization vector parameters.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,30 @@
*/


package com.google.k2crypto;
package com.google.k2crypto.keyversions;

import javax.crypto.Cipher;

/**
* This class represents a SymmetricKey in K2. It is abstract and extended by specific symmetric key
* implementations such as AESKey
* This class represents a SymmetricKeyVersion in K2. It is abstract and extended by specific
* symmetric key version implementations such as AESKey
*
* @author John Maheswaran ([email protected])
*/
public abstract class SymmetricKeyVersion extends KeyVersion {

/**
* Method that returns the symmetric key version's encrypting Cipher
*
* @return The Cipher used to encrypt data
*/
public abstract Cipher getEncryptingCipher();

/**
* Method that returns the symmetric key version's decrypting Cipher
*
* @return The Cipher used to decrypt data
*/
public abstract Cipher getDecryptingCipher();

}
53 changes: 0 additions & 53 deletions java/src/test/java/com/google/k2crypto/KeyModifierException.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@

import static org.junit.Assert.assertEquals;

import com.google.k2crypto.exceptions.BuilderException;
import com.google.k2crypto.exceptions.DecryptionException;
import com.google.k2crypto.exceptions.EncryptionException;
import com.google.k2crypto.keyversions.AESKeyVersion;
import com.google.k2crypto.keyversions.SymmetricKeyVersion;
import com.google.k2crypto.keyversions.AESKeyVersion.Mode;

import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,16 @@
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;

import com.google.k2crypto.BuilderException;
import com.google.k2crypto.DecryptionException;
import com.google.k2crypto.EncryptionException;
import com.google.k2crypto.SymmetricEncryption;
import com.google.k2crypto.exceptions.BuilderException;
import com.google.k2crypto.exceptions.DecryptionException;
import com.google.k2crypto.exceptions.EncryptionException;
import com.google.k2crypto.keyversions.AESKeyVersion.Mode;

import org.junit.Test;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;

/**
* Tests for AESkeyVersion class
Expand Down