Sha256: 0a1d4da26c9ca35ae7748b12412793bfbf90de9ebb2ddbda564c58a513e86ad2

Contents?: true

Size: 875 Bytes

Versions: 11

Compression:

Stored size: 875 Bytes

Contents

require 'spec_helper'
require 'tempfile'

describe Arachni::Support::Crypto::RSA_AES_CBC do

    SEED = 'seed data'

    before :all do
        private_key_file = Tempfile.new( 'private_key.pem' )
        private_key = OpenSSL::PKey::RSA.generate( 1024 )
        private_key_file.write( private_key.to_pem )
        private_key_file.close

        public_key  = private_key.public_key
        public_key_file = Tempfile.new( 'public_key.pem' )
        public_key_file.write( public_key.to_pem )
        public_key_file.close

        @private_key_file_path = private_key_file.path
        @public_key_file_path = public_key_file.path

        @crypto = described_class.new( @public_key_file_path, @private_key_file_path )
    end

    it 'generates matching encrypted and decrypted data' do
        expect(@crypto.decrypt( @crypto.encrypt( SEED ) )).to eq(SEED)
    end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
arachni-1.6.1.3 spec/arachni/support/crypto/rsa_aes_cbc_spec.rb
arachni-1.6.1.2 spec/arachni/support/crypto/rsa_aes_cbc_spec.rb
arachni-1.6.1.1 spec/arachni/support/crypto/rsa_aes_cbc_spec.rb
arachni-1.6.1 spec/arachni/support/crypto/rsa_aes_cbc_spec.rb
arachni-1.6.0 spec/arachni/support/crypto/rsa_aes_cbc_spec.rb
arachni-1.5.1 spec/arachni/support/crypto/rsa_aes_cbc_spec.rb
arachni-1.5 spec/arachni/support/crypto/rsa_aes_cbc_spec.rb
arachni-1.4 spec/arachni/support/crypto/rsa_aes_cbc_spec.rb
arachni-1.3.2 spec/arachni/support/crypto/rsa_aes_cbc_spec.rb
arachni-1.3.1 spec/arachni/support/crypto/rsa_aes_cbc_spec.rb
arachni-1.3 spec/arachni/support/crypto/rsa_aes_cbc_spec.rb