GithubHelp home page GithubHelp logo

alainmeier / cryptonote Goto Github PK

View Code? Open in Web Editor NEW
181.0 12.0 34.0 196 KB

:lock: A simple open source web application that lets users encrypt and share messages that can only be read once.

Home Page: https://cryptonote.me

License: MIT License

Ruby 55.70% CSS 25.72% JavaScript 9.03% HTML 9.56%

cryptonote's Introduction

CryptoNote

Deploy

CryptoNote in action

CryptoNote is a very simple open source web application that lets users encrypt and share messages. If you'd like to see an example of the site running, go to https://cryptonote.me

  • All data is encrypted client side so that the server never sees what's on it.
  • Messages are deleted from the server once the recipient has viewed it.
  • Bots like Facebook are blocked so that they do not invalidate messages.

Motivation

Sometimes you need to send something to somebody and be sure that they're the only person reading the message. So I decided to make a simple, open source, encrypted messaging system that anybody can pull and deploy to Heroku in minutes. Don't trust me? That's cool, install your own. Don't trust your web host? That's cool, they'll never be able to read your messages.

Known Weaknesses

Getting Started

System dependencies

  • Ruby 2.2.0 or higher
  • Rails 4.1.8 or higher
  • Postgres 9.2.4 or greater
  • Heroku Toolbelt

Configuration

Ensure that you have Postgres installed, preferably through the Heroku Postgres App as we use it in both production and development.

Then, open your terminal to the project folder and run:

rake db:setup
rake db:migrate

Deployment instructions

Run the following commands to get started:

heroku create
git push heroku master
heroku run rake db:migrate

And then run:

heroku open

In order to open the application.

Contributing

I'm always open to pull requests, and there's a lot more that could be done with the site. In general, I will tend towards "track less", so I never want CryptoNote to have user accounts or anything like that. However, there are always cool things that can be done.

Ideas for the future

  • Limit viewing by http referrer. For example, only people who clicked the link on Facebook or Twitter can view the message
  • Time-based expiry. Make messages automatically die after x period of time.
  • Javascript submission so we can carry over the password variable client-side instead of sending it to the server.
  • The application.js file has some horrendously bad javascript that I may or may not rewrite soon depending on time. Don't hate the player, hate the time constraint.
  • Allow Markdown in decrypted messages.
  • Allow code highlighting in decrypted messages.
  • An API endpoint for creating new CryptoNotes + javascript package to do the crypto easily.

License

CryptoNote is released under the terms of the MIT license. See LICENCE for more information or see http://opensource.org/licenses/MIT.

Special Thanks

For the client-side encryption, all of the heavy lifting is done by the Stanford Javascript Crypto Library. Part of the reason I make this project was to help spread the word about the simple, but extremely well made library that anybody can use. Thanks to the team who made it!

cryptonote's People

Contributors

alainmeier avatar bndr avatar dependabot[bot] avatar m3nix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cryptonote's Issues

Improve tests

Right now the testing is non-existent, so fleshing that out would be nice despite the simplicity of the app.

db:setup?

Instructions say run

rake db:setup

But it errors out for my local fork when I try to setup up the database. Looks like the repo is missing a database.yml file?

Error:

johnbackus$ rake db:setup
rake aborted!
Could not load database configuration. No such file - /Users/johnbackus/Dropbox/coding/cryptonote/config/database.yml
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc2/lib/rails/application/configuration.rb:110:in `database_configuration'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-4.0.0.rc2/lib/active_record/railtie.rb:43:in `block in <class:Railtie>'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc2/lib/rails/railtie.rb:201:in `instance_exec'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc2/lib/rails/railtie.rb:201:in `block in run_tasks_blocks'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc2/lib/rails/railtie.rb:201:in `each'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc2/lib/rails/railtie.rb:201:in `run_tasks_blocks'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc2/lib/rails/application.rb:243:in `block in run_tasks_blocks'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc2/lib/rails/engine/railties.rb:17:in `each'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc2/lib/rails/engine/railties.rb:17:in `each'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc2/lib/rails/application.rb:243:in `run_tasks_blocks'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc2/lib/rails/engine.rb:446:in `load_tasks'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc2/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/johnbackus/Dropbox/coding/cryptonote/Rakefile:6:in `<top (required)>'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load_rakefile'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/rake-10.0.4/lib/rake/application.rb:589:in `raw_load_rakefile'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/rake-10.0.4/lib/rake/application.rb:89:in `block in load_rakefile'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/rake-10.0.4/lib/rake/application.rb:88:in `load_rakefile'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/rake-10.0.4/lib/rake/application.rb:72:in `block in run'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `eval'
/Users/johnbackus/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)

Passphrase

Allow someone to enable a passphrase on top of the encryption that is required in order to open and thus delete the message.

Add Cryptonote API

Add a simple REST API so that the link can be generated programmatically.

The caller would provide a text and the API would return a link.

SQLite database migration fails

Using the Dockerfile below, the SQLite migration seems to fail:

FROM ruby:2.5.3

ENV RAILS_ENV production

RUN apt-get install git

RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y nodejs

WORKDIR /app

RUN git clone https://github.com/alainmeier/cryptonote.git .
RUN cp config/database.yml.sample config/database.yml
RUN echo "gem 'sqlite3', '~> 1.3.6'" >> Gemfile
RUN ./bin/bundle install
RUN ./bin/rake assets:precompile
RUN ./bin/rake db:setup
RUN ./bin/rake db:migrate

CMD ./bin/rails server

It gives the following error:

Step 12/14 : RUN ./bin/rake db:setup
 ---> Running in 406c851864e1
rake aborted!
ActiveRecord::StatementInvalid: SQLite3::SQLException: near "(": syntax error: CREATE TABLE "messages" ("id" uuid DEFAULT uuid_generate_v4() NOT NULL PRIMARY KEY, "content" text, "location" varchar, "password" varchar, "latitude" float, "longitude" float, "created_at" datetime, "updated_at" datetime, "encryption_key" varchar, "salt" varchar, "deleted" boolean DEFAULT 'f')
/usr/local/bundle/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:in `initialize'
/usr/local/bundle/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:in `new'
/usr/local/bundle/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:in `prepare'
/usr/local/bundle/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:137:in `execute'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in `block in execute'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract_adapter.rb:590:in `block in log'
/usr/local/bundle/gems/activesupport-5.0.7.2/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract_adapter.rb:583:in `log'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in `execute'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:278:in `create_table'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/migration.rb:846:in `block in method_missing'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/migration.rb:815:in `block in say_with_time'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/migration.rb:815:in `say_with_time'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/migration.rb:835:in `method_missing'
/app/db/schema.rb:19:in `block in <top (required)>'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/schema.rb:48:in `instance_eval'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/schema.rb:48:in `define'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/schema.rb:44:in `define'
/app/db/schema.rb:13:in `<top (required)>'
/usr/local/bundle/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:287:in `load'
/usr/local/bundle/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:287:in `block in load'
/usr/local/bundle/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:259:in `load_dependency'
/usr/local/bundle/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:287:in `load'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/tasks/database_tasks.rb:226:in `load_schema'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/tasks/database_tasks.rb:255:in `block in load_schema_current'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/tasks/database_tasks.rb:295:in `block in each_current_configuration'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/tasks/database_tasks.rb:292:in `each'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/tasks/database_tasks.rb:292:in `each_current_configuration'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/tasks/database_tasks.rb:254:in `load_schema_current'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/railties/databases.rake:248:in `block (3 levels) in <top (required)>'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/railties/databases.rake:252:in `block (3 levels) in <top (required)>'
SQLite3::SQLException: near "(": syntax error
/usr/local/bundle/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:in `initialize'
/usr/local/bundle/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:in `new'
/usr/local/bundle/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:in `prepare'
/usr/local/bundle/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:137:in `execute'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in `block in execute'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract_adapter.rb:590:in `block in log'
/usr/local/bundle/gems/activesupport-5.0.7.2/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract_adapter.rb:583:in `log'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in `execute'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:278:in `create_table'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/migration.rb:846:in `block in method_missing'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/migration.rb:815:in `block in say_with_time'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/migration.rb:815:in `say_with_time'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/migration.rb:835:in `method_missing'
/app/db/schema.rb:19:in `block in <top (required)>'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/schema.rb:48:in `instance_eval'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/schema.rb:48:in `define'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/schema.rb:44:in `define'
/app/db/schema.rb:13:in `<top (required)>'
/usr/local/bundle/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:287:in `load'
/usr/local/bundle/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:287:in `block in load'
/usr/local/bundle/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:259:in `load_dependency'
/usr/local/bundle/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:287:in `load'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/tasks/database_tasks.rb:226:in `load_schema'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/tasks/database_tasks.rb:255:in `block in load_schema_current'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/tasks/database_tasks.rb:295:in `block in each_current_configuration'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/tasks/database_tasks.rb:292:in `each'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/tasks/database_tasks.rb:292:in `each_current_configuration'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/tasks/database_tasks.rb:254:in `load_schema_current'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/railties/databases.rake:248:in `block (3 levels) in <top (required)>'
/usr/local/bundle/gems/activerecord-5.0.7.2/lib/active_record/railties/databases.rake:252:in `block (3 levels) in <top (required)>'
Tasks: TOP => db:schema:load
(See full trace by running task with --trace)
Created database 'db/production.sqlite3'
-- enable_extension("plpgsql")
   -> 0.0002s
-- enable_extension("uuid-ossp")
   -> 0.0000s
-- create_table("messages", {:id=>:uuid, :default=>#<Proc:0x00005622e65b0d38@/app/db/schema.rb:19 (lambda)>, :force=>:cascade})
The command '/bin/sh -c ./bin/rake db:setup' returned a non-zero code: 1

Syntax highlighting

I sometimes share code on Cryptonote, so it would be nice to have a code mode that enables syntax highlighting for the recipient.

Add request throttling

Though there is a lot of entropy in both the ID of the message and in the generated password, it would not hurt to add some request throttling to prevent some brute force attacks. Something like Rack Attack would be perfect.

Time expiration

Add the ability to set an expiration time if a message is not read. It should default to 30 days as that is a more secure default than allowing a message to sit on the server forever, encrypted or not.

Install not @ heroku

Hi,

is it possible to use this tool somewhere else than at Heroku ?
Any way to install this simply on an server ?

thanks for your replies

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.