Sha256: fc26d88cfdbd3610e1014a7841dd7ae65766460fe653f90821739b68a37ca3af

Contents?: true

Size: 1.67 KB

Versions: 7

Compression:

Stored size: 1.67 KB

Contents

# frozen_string_literal: true
#
# Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
#
# Ronin Support is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ronin Support is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Ronin Support.  If not, see <http://www.gnu.org/licenses/>.
#

require 'ronin/support/crypto/cipher/aes'

module Ronin
  module Support
    module Crypto
      class Cipher < OpenSSL::Cipher
        #
        # The AES128 cipher.
        #
        class AES128 < AES

          #
          # Initializes the AES 128bit cipher.
          #
          # @param [Symbol] hash
          #   The hashing algorithm to use to generate the key.
          #
          # @param [Hash{Symbol => Object}] kwargs
          #   Additional keyword arguments for {AES#initialize}.
          #
          def initialize(hash: :md5, **kwargs)
            super(key_size: 128, hash: hash, **kwargs)
          end

          #
          # The list of supported AES 128bit ciphers.
          #
          # @return [Array<String>]
          #   The list of supported AES 128bit cipher names.
          #
          def self.supported
            super().grep(/^aes(?:-)?128/)
          end

        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ronin-support-1.0.7 lib/ronin/support/crypto/cipher/aes128.rb
ronin-support-1.0.6 lib/ronin/support/crypto/cipher/aes128.rb
ronin-support-1.0.5 lib/ronin/support/crypto/cipher/aes128.rb
ronin-support-1.0.4 lib/ronin/support/crypto/cipher/aes128.rb
ronin-support-1.0.3 lib/ronin/support/crypto/cipher/aes128.rb
ronin-support-1.0.2 lib/ronin/support/crypto/cipher/aes128.rb
ronin-support-1.0.1 lib/ronin/support/crypto/cipher/aes128.rb