Sha256: 4a8aee2e4689bca79dac90d58d91a4aea8e274f29e5eb48eba10eba2329787d8

Contents?: true

Size: 401 Bytes

Versions: 50

Compression:

Stored size: 401 Bytes

Contents

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

50 entries across 50 versions & 1 rubygems

Version Path
flydata-0.3.5 lib/flydata/command/encrypt.rb
flydata-0.3.4 lib/flydata/command/encrypt.rb
flydata-0.3.3 lib/flydata/command/encrypt.rb
flydata-0.3.2 lib/flydata/command/encrypt.rb
flydata-0.3.1 lib/flydata/command/encrypt.rb
flydata-0.3.0 lib/flydata/command/encrypt.rb
flydata-0.2.30 lib/flydata/command/encrypt.rb
flydata-0.2.29 lib/flydata/command/encrypt.rb
flydata-0.2.28 lib/flydata/command/encrypt.rb
flydata-0.2.27 lib/flydata/command/encrypt.rb
flydata-0.2.26 lib/flydata/command/encrypt.rb
flydata-0.2.25 lib/flydata/command/encrypt.rb
flydata-0.2.24 lib/flydata/command/encrypt.rb
flydata-0.2.23 lib/flydata/command/encrypt.rb
flydata-0.2.22 lib/flydata/command/encrypt.rb
flydata-0.2.21 lib/flydata/command/encrypt.rb
flydata-0.2.20 lib/flydata/command/encrypt.rb
flydata-0.2.19 lib/flydata/command/encrypt.rb
flydata-0.2.18 lib/flydata/command/encrypt.rb
flydata-0.2.17 lib/flydata/command/encrypt.rb