Class: Snowden::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/snowden/configuration.rb

Overview

The object that holds all the configuration details for Snowden

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Sets up the configuration object



22
23
24
25
26
# File 'lib/snowden/configuration.rb', line 22

def initialize
  @edit_distance     = 3
  @cipher_spec       = "AES-256-CBC"
  @padding_byte_size = 32
end

Instance Attribute Details

#backendObject

Returns the value of attribute backend.



19
20
21
# File 'lib/snowden/configuration.rb', line 19

def backend
  @backend
end

#cipher_specString

an OpenSSL cipher spec to use with Snowden. Defaults to “AES-256-CBC”.

Returns:

  • (String)

    the current value of cipher_spec



18
19
20
# File 'lib/snowden/configuration.rb', line 18

def cipher_spec
  @cipher_spec
end

#edit_distanceInteger

the size of the edit distance sets that are created when searching and storing strings. See an example at: gist.github.com/samphippen/6621771. Defaults to 3.

Returns:

  • (Integer)

    the current value of edit_distance



18
19
20
# File 'lib/snowden/configuration.rb', line 18

def edit_distance
  @edit_distance
end

#padding_byte_sizeInteger

the amount of random padding to add to values stored in the index. Defaults to 32. Change at your own risk. Never set to lower than 2 blocks if you’re using a block cipher.

Returns:

  • (Integer)

    the current value of padding_byte_size



18
19
20
# File 'lib/snowden/configuration.rb', line 18

def padding_byte_size
  @padding_byte_size
end