public EncryptedDeck encryptDeck(Deck deck)
			throws InvalidKeyException, IllegalBlockSizeException,
			BadPaddingException {
		
		if (e == null) {
			System.err
					.println("Cannot encrypt when using decrypting constructor RSAService(gp, gq, gd)");
			return null;
		}
		EncryptedDeck encDeck = new EncryptedDeck();
		for (int i = 0; i < Deck.NUM_CARDS; i++) {
			EncryptedCard tmp = encryptCard(deck.getCardAtIndex(i));
			if (i >= encDeck.data.size()) {
				encDeck.data.add(tmp);
			} else {
				encDeck.data.set(i, tmp);
			}

		}
		return encDeck;
	}