class Ronin::CLI::Commands::Rot
Rotates each character of data within an alphabet.
## Usage
ronin rot [options] [FILE ...]
## Options
-f, --file FILE Optional file to process --string STRING Optional string to process -M, --multiline Process each line separately --keep-newlines Preserves newlines at the end of each line -A, --alphabet ABC... Alphabet characters -n, --modulo NUM Number of characters to rotate (Default: 13) -h, --help Print help information
## Arguments
[FILE ...] Optional file(s) to process
Attributes
alphabets[R]
The alphabets to rotate within.
@return [Array<Array<String>>]
modulo[R]
The number of characters to rotate.
@return [Integer]
Public Class Methods
new(**kwargs)
click to toggle source
Initializes the ‘ronin rot` command.
@param [Hash{Symbol => Object}] kwargs
Additional keywords.
Calls superclass method
# File lib/ronin/cli/commands/rot.rb, line 88 def initialize(**kwargs) super(**kwargs) @modulo = 13 @alphabets = [] end
Public Instance Methods
process_string(string)
click to toggle source
Rotates each character in the string.
@param [String] string
The input string.
@return [String]
The rotated string.
# File lib/ronin/cli/commands/rot.rb, line 104 def process_string(string) unless @alphabets.empty? Support::Crypto.rot(string,@modulo, alphabets: @alphabets) else Support::Crypto.rot(string,@modulo) end end