Git Product home page Git Product logo

didme.me's Introduction

did:meme

What's new in v2?

TLDR: DID Meme, is no longer a "DID Method".

In v2, DID Meme is simply a way to share did:jwk for experimental post quantum cryptography.

example keys

If you see an image on social media you think might have an identifier inside, you can try to "resolve" the identifier from the image itself.

If this process succeeds, you can decide to trust the identifier based on the context you have for it from social media.

For example: twitter.com/OR13b/status/1584257036966973441

didme.me's People

Contributors

or13 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

wanghaisheng

didme.me's Issues

Error: StegImage#hideBlob: Mismatch after verification on image upload / key creation

Error seen when while creating Dilithium, Falcon, or Sphincs key (tried all three)

918-9082c82850feae6b.js:28 Uncaught (in promise) Error: StegImage#hideBlob: Mismatch after verification; idx=1672 v1=27 v2=26 pos=0
    at b.hideBlob (918-9082c82850feae6b.js:28:42072)
    at b.hide (918-9082c82850feae6b.js:28:40892)
hideBlob @ 918-9082c82850feae6b.js:28
hide @ 918-9082c82850feae6b.js:28
Promise.then (async)
r @ 250-dc31191b7050df30.js:79
a @ 250-dc31191b7050df30.js:79
(anonymous) @ 250-dc31191b7050df30.js:79
(anonymous) @ 250-dc31191b7050df30.js:79
L.K @ index-555696497172b87e.js:1
(anonymous) @ index-555696497172b87e.js:1
(anonymous) @ main-bdaeb5abf53759e5.js:1
(anonymous) @ main-bdaeb5abf53759e5.js:1
r @ 250-dc31191b7050df30.js:79
g @ 250-dc31191b7050df30.js:79
Promise.then (async)
r @ 250-dc31191b7050df30.js:79
a @ 250-dc31191b7050df30.js:79
(anonymous) @ 250-dc31191b7050df30.js:79
(anonymous) @ 250-dc31191b7050df30.js:79
setTimeout (async)
(anonymous) @ index-555696497172b87e.js:1
load (async)
E @ index-555696497172b87e.js:1
(anonymous) @ index-555696497172b87e.js:1
(anonymous) @ 918-9082c82850feae6b.js:28
(anonymous) @ 918-9082c82850feae6b.js:28
Promise.then (async)
(anonymous) @ 918-9082c82850feae6b.js:28
(anonymous) @ 918-9082c82850feae6b.js:28
(anonymous) @ 918-9082c82850feae6b.js:28
eA @ framework-7751730b10fa0f74.js:1
eq @ framework-7751730b10fa0f74.js:1
(anonymous) @ framework-7751730b10fa0f74.js:1
rg @ framework-7751730b10fa0f74.js:1
rv @ framework-7751730b10fa0f74.js:1
(anonymous) @ framework-7751730b10fa0f74.js:1
oq @ framework-7751730b10fa0f74.js:1
eD @ framework-7751730b10fa0f74.js:1
rx @ framework-7751730b10fa0f74.js:1
nB @ framework-7751730b10fa0f74.js:1
nA @ framework-7751730b10fa0f74.js:1

Test image (related):

alice-suprised-post-curtsy

Code in question?:

import { RawFile, StegImage, utils } from 'steg';
import { scrypt } from '@noble/hashes/scrypt';
const { DID, JWK } = require('@transmute/did-jwk-pqc');
const stegHardness = 5;
const scryptConfig = {
N: 2 ** 19,
r: 8,
p: 1
};
const encode = async (
querySelector,
securePassword,
secureSalt,
alg = 'CRYDI5'
) => {
const passwordBasedKey = scrypt(securePassword, secureSalt, scryptConfig);
const key = await JWK.generateKeyPair(alg);
const did = DID.toDid(key.publicKeyJwk);
const file = new RawFile(
utils.utf8ToBytes(did.replace('did:jwk:', '')),
'did:jwk'
);
const el = document.querySelector(querySelector);
const png = new StegImage(el);
const hiddenPngUrl = await png.hide(file, passwordBasedKey, stegHardness);
const didDocument = await DID.operations.resolve(did);
return {
did,
image: hiddenPngUrl,
didDocument,
privateKeyJwk: key.privateKeyJwk
};
};
const decode = async (querySelector, securePassword, secureSalt) => {
const passwordBasedKey = scrypt(securePassword, secureSalt, scryptConfig);
const el = document.querySelector(querySelector);
const png = new StegImage(el);
const revealed = await png.reveal(passwordBasedKey);
const did = revealed.name + ':' + utils.bytesToUtf8(revealed.data);
const { publicKeyJwk } = await DID.operations.dereference(did + '#0');
const emojid = await DID.getEmojid(publicKeyJwk);
const dataUrl = png.canvas.toDataURL();
return { emojid, did, publicKeyJwk, dataUrl };
};
const image = { encode, decode };
export default image;

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.