Sha256: ca5cfeb94ada873adcb271fa9f392f0d0a262aaeaf289ccf6f97b801c0594ade

Contents?: true

Size: 466 Bytes

Versions: 92

Compression:

Stored size: 466 Bytes

Contents

require 'flydata/command/base'
require 'flydata/util/encryptor'

module Flydata
  module Command
    class Encrypt < Base
      def run
        dp = flydata.data_port.get
        key = dp['key']
        text = ask_password
        encrypted_text = Flydata::Util::Encryptor.encrypt(text, key)
        puts "Encrypted text: #{encrypted_text}"
      end

      private
      def ask_password
        ask("Enter text: ") { |x| x.echo = "*" }
      end
    end
  end
end

Version data entries

92 entries across 92 versions & 1 rubygems

Version Path
flydata-0.8.10.2 lib/flydata/command/encrypt.rb
flydata-0.8.10.1 lib/flydata/command/encrypt.rb
flydata-0.8.9.11 lib/flydata/command/encrypt.rb
flydata-0.8.10 lib/flydata/command/encrypt.rb
flydata-0.8.9 lib/flydata/command/encrypt.rb
flydata-0.8.8 lib/flydata/command/encrypt.rb
flydata-0.8.7 lib/flydata/command/encrypt.rb
flydata-0.8.6 lib/flydata/command/encrypt.rb
flydata-0.8.5 lib/flydata/command/encrypt.rb
flydata-0.8.4 lib/flydata/command/encrypt.rb
flydata-0.8.3 lib/flydata/command/encrypt.rb
flydata-0.8.2 lib/flydata/command/encrypt.rb
flydata-0.8.1 lib/flydata/command/encrypt.rb
flydata-0.8.0 lib/flydata/command/encrypt.rb
flydata-0.7.19 lib/flydata/command/encrypt.rb
flydata-0.7.18 lib/flydata/command/encrypt.rb
flydata-0.7.17 lib/flydata/command/encrypt.rb
flydata-0.7.16 lib/flydata/command/encrypt.rb
flydata-0.7.15 lib/flydata/command/encrypt.rb
flydata-0.7.14 lib/flydata/command/encrypt.rb