Git Product home page Git Product logo

hardbin's Issues

Insecure Cryptography

hardbin/js/hardbin.js

Lines 5 to 11 in c77c2d7

function encrypt(data, key) {
return CryptoJS.AES.encrypt(data, key).toString();
}
function decrypt(data, key) {
return CryptoJS.AES.decrypt(data, key).toString(CryptoJS.enc.Utf8);
}
-> http://cryptojs.altervista.org/secretkey/doc/doc_aes_cryptojs-v3.html

You're using unauthenticated AES-CBC. https://paragonie.com/blog/2015/05/using-encryption-and-authentication-correctly

Your About section says:

Since nobody can modify the code, and nobody can view the key unless you show it to them, nobody without the key can either read the plaintext or ship a malicious viewer which would exfiltrate the plaintext (or key).

...but this is strictly not true with unauthenticated encryption. In fact, you can recover the plaintext with a padding oracle attack.

Also, your RNG is biased.

hardbin/js/hardbin.js

Lines 13 to 25 in c77c2d7

function generate_key() {
var alphabet = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
var randombytes = new Uint8Array(32);
crypto.getRandomValues(randombytes);
var k = '';
for (var i = 0; i < 32; i++) {
var idx = Math.floor(randombytes[i] * alphabet.length / 256);
k += alphabet.charAt(idx);
}
return k;
}

Subdomain gateway support

When accessing via a subdomain gateway it is unable to resolve

ipfs resolve -r /ipfs/bafybeidu5fa3wnoj6ixuluw6h5otbnsicgwbma7xhnao7zs3wpcn3nj7te/ipfs/bafybeiczbt5m3sox6r7drnzhg5dln33vffy372b42x2v7pmchncqrbbxxu: no link named "ipfs" under bafybeidu5fa3wnoj6ixuluw6h5otbnsicgwbma7xhnao7zs3wpcn3nj7te

Could change the hash replace to <cid>.ipfs.localhost:8080/#<decryption_key>-firstview

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.