Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

text-smuggler

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

text-smuggler

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Text Smuggler

TextSmuggler makes it easy to obfuscate pieces of text which need to be decoded later on, using OpenSSL::Cipher. Possibly incorporated in a URL.

Put this in your Gemfile:

gem 'text-smuggler'

Then use it like this:

secret_location = 'The secret location of Luke Skywalker is xxxxxx.'
han_solo = TextSmuggler.new key: 'change_me'

encoded = han_solo.encode secret_location

# Now you can use this string in a database or in a URL quite safely.
# And then when you need to decode it...

decoded = han_solo.decode encoded

You can also initialize a TextSmuggler with a specific type of ciper. The default is aes-256-cbc.

smuggler = TextSmuggler.new({
  key: 'change_me',
  cipher_type: 'aes-256-cbc'
})

For more details about OpenSSL::Cipher, you can read documentation here

Warning

Bear in mind that while this method is quite safe, you should only use it when you absolutely have to retrieve the data. For example, avoid saving passwords in a database with this method. Passwords only need to be compared and are safer if they are saved with a non-reversible method (i.e. Hashed and salted).

FAQs

Package last updated on 10 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc