Cryptonite is a browser extension (add-on) designed to protect users from malicious attacks and phishing scams through the use of the extension's visual indicator, the Cryptonite shield.
When the shield turns green, users can be confident the website they're visiting is a trusted resource verified by MetaCert. When users visit a malicious or phishing URL, it directs them to a block page with a warning that they're about to visit a known malicious resource.
Cryptonite is powered by the MetaCert Protocol, one of the world's largest threat intelligence databases. Cryptonite is available for Google Chrome, Mozilla Firefox and Opera.
- You can either download the project files as a ZIP file or check the project files.
- Open your browser and load the files into the browser as an unpacked extension:
- On Chrome: go to
chrome://extensions/
select the optionLOAD UNPACKED
and then select thesrc
folder from the project - On Opera: go to
about://extensions
select the optionLoad Unpacked Extension
and then select thesrc
folder from the project - On Firefox: go to
about:debugging#addons
select the optionLoad Temporary Addon...
and then select themanifest.json
file from inside thesrc
folder from the project
- The add-on should be installed in your browser and ready to be used.
There are two ways to debug the add-on:
- Add
console.log("Your message", yourObject);
anywhere in the project where you want to debug messages - Search for the line
this.debugActive = false;
and change it tothis.debugActive = true;
. Then addcryptonite.debug("Your message", yourObject);
anywhere in the project where you want to debug messages
There are several ways to scan the Javascript files in the project with jslint:
- From the command-line, execute:
$ grunt jslint
This will result in a file called grunt-jslint-results.log in the output folder.
When calling this command, you are using the grunt package called grunt-jslint
.
All the configuration for this grunt call is inside the file Gruntfile.js in the jslint
config section.
- From the command-line, execute:
$ grunt cryptonite-jslint
This will result in a file called jslint-results.log in the output folder.
If you execute:
$ grunt cryptonite-jslint --c
the results will be displayed on the console instead of a log file.
When calling the grunt cryptonite-jslint
command you are using the jslint
command-line feature from the node package, which is called inside a grunt wrapper. The configuration for the grunt cryptonite-jslint
command is inside a file called jslint.conf
- From the command-line, execute:
$ jslint 'path/to/your/file' > output/results.log
This will result in a file called results.log in the output folder.
If you call jslint
directly, you can scan a single file or a set of files. For example:
$ jslint 'src/js/**/*.js' > output/results.log
will scan all the files in the project, and
$ jslint 'src/js/background/background.js' > output/results.log
will scan the background.js file only.
If you want the results in the console instead of a log file, you can call something like:
$ jslint --color 'src/js/background/background.js'
When calling the jslint
command you are using the jslint
command-line feature from the node package directly. The configuration for this jslint
command is inside a file called jslint.conf.
To generate the jsodc
documentation on the Cryptonite code, you need execute the following command:
$ grunt jsdoc
a folder called output/doc will be created. This folder will contain all the generated documentation.
From the command-line, execute:
$ jsdoc2md 'src/js/**/*.js' > output/wiki.md
a file with all the wiki information will be generated in the output folder. You need to copy-and-paste the contents of this file to the wiki page on the repository.
- Make sure you have a working folder with two repositories:
internal-cryptonite
: https://github.com/metacert/internal-cryptonite andcryptonite
: https://github.com/metacert/cryptonite - Make sure both folders
internal-cryptonite
andcryptonite
are at the same level - Go to the
cryptonite
folder on your local machine and setdevelop
as your current working branch - Pull the latest changes from the
develop
branch into thecryptonite
folder - Go to the
internal-cryptonite
folder on your local machine and setdevelop
as your current working branch - Pull the latest changes from the
develop
branch into theinternal-cryptonite
folder - From the command-line, execute:
$ grunt update-repo
This command will copy all the files from the internal-cryptonite
folder to the cryptonite
folder. This command will also remove all the sensitive information from the cryptonite
folder, like the keys to call the MetaCert API
8. On the cryptonite
repository, commit all the changes inside the cryptonite
folder. Make sure you are committing the changes into the develop
branch
9. On the cryptonite
repository, merge your changes from the develop
branch into the master branch