add protected function _create_iv to proxy mcrypt_create_iv

added a protected function `_create_iv`

This is to proxy the mcrypt_create_iv function
and to allow mocking and testing against KAT vectors.
Unit test for the Encrypt class

Adds a class Kohana_EncryptTest_TestableEncrypt that wraps the
Encrypt class to mock out the actual mcrypt_create_iv calls.

The test data are provided by
Cryptographic Algorithm Validation Program
National Institute of Standards and Technology

http://csrc.nist.gov/groups/STM/cavp/index.html
More Encrypt tests

test_encode_decode:
Explicitly verifying that value > encode > decode === value

test_decode_invalid_data:
Tests for decode when the string is not valid base64, or is too short to
contain a valid IV

test_consecutive_encode_produce_different_results:
A test without the iv stubbed to verify that consecutive calls to encode
the same value produce different results

test_instance_throw_exception_when_no_key_provided
When an encryption key is not configured, the method `instance`
should throw a Kohana_Exception

test_instance_returns_singleton
Tests for method instance - that it returns singleton, that an instance
created through the instance method has the expected configuration
minor readability changes
Kohana_EncryptTest_TestableEncrypt to Kohana_EncryptTest_IvStubbed

Renamed Kohana_EncryptTest_TestableEncrypt to
Kohana_EncryptTest_IvStubbed so that I can add
another testable class

Also feed the known IV from the constructor now
instead of setting the property separately
Encryption key B/C compatible padding for PHP 5.6

Added a protected `_normalize_key` method to pad keys with
null bytes similar to PHP versions older than PHP 5.6 this
is called from the constructor when PHP version is above 5.6.0

Added Kohana_EncryptTest_KeyNormalized that always forces key
normalization, used in test_key_normalization.

Added test_key_normalization which tests our null byte padding
for encryption keys only against lower versions of PHP (< 5.6.0)
to see that it matches the internal key padding those PHP
versions already have.
tabs instead of whitespaces as per coding standards
Declare _key _mode _cipher _iv_size properties protected

Declared `_key`, `_mode`, `_cipher`, and `_iv_size` properties
that were originally created dynamically.

Added `assertSameProtectedProperty` as a helper method for the
tests, it uses reflection to access and test the values of those
properties
Merge pull request #560 from kohana/3.3/test/encrypt

Unit test for the Encrypt class