Giter Club home page Giter Club logo

private-fraud-prevention's People

Contributors

eriktaubeneck avatar siyengar avatar

Stargazers

 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

private-fraud-prevention's Issues

Textbook RSA?

Hi
I'm glad that Facebook™ is working on anonymous credentials to protect the privacy of its users!
Reading the source code I had a few concerns:

The token which is generated here:

nonce = browser.get_random_bytes();

@blinding_service.route('/.well-known/random-bytes/<int:bytecount>')
def random_bytes(bytecount):
return hexlify(get_random_bytes(bytecount))

then blinded here:

def blind_message(
public_key: Any,
message: bytes,
blinding_factor: bytes,
) -> bytes:
if type(public_key) == bytes:
public_key = RSA.importKey(public_key)
return public_key.blind(message, blinding_factor)

and signed here:
def sign_message(
rsa_key: Any,
message: bytes,
) -> bytes:
sig = rsa_key.sign(message, b'')[0].to_bytes(256, 'big')
return sig

does not prevent one-more unforgeability.
Am I saying something terribly wrong here? The following attack would work, correct?

In [1]: import crypto
In [8]: import os
In [9]: token = os.urandom(16)
In [10]: blind = os.urandom(16)
In [3]: sk = crypto.get_rsa_key(None)
In [5]: pk = crypto.get_public_key(None)
In [12]: blinded_message = crypto.blind_message(pk, token, blind)
In [19]: signature = crypto.sign_message(sk, blinded_message)
In [20]: signature = crypto.unblind_message(pk, signature, blind)
In [21]: crypto.validate_signature(pk, token, signature)
Out[21]: True
In [34]: signature2 = (int.from_bytes(signature, 'big')**2 % pk.n).to_bytes(512, 'big')
In [35]: token2 = (int.from_bytes(token, 'big')**2 % pk.n).to_bytes(32, 'big')
In [36]: crypto.validate_signature(pk, token2, signature2)
Out[36]: True

Even more importantly, is it correct to say that right now the client is asking for the entropy to the server, including token and blinding factor? Wouldn't this break unlinkability?

Hope this will be useful to you, cheers!

Complicated and ambigious performance of explanation in README file aka Let's make README great again

After perusing this file, I've noticed that there are many complicated potentially misleading statements. At least It was quite a hard reading because of ambiguity and imlicitly stated terms.I can and would like to make it more simple as well as to untangle puzzled explanation, thus hopefully making this pretty complicated scientific subject as much straightforward as possible. But I will need your help, specificity the authors and editors of this text since it requires knowledge about resources and projects mentioned here.

A suggestion for partially-blind signatures

Have you maybe considered using a hash of the URL for e, the RSA public exponent?

Like, if we want to sign the equivalent of "this blinded nonce touched me, on the way to URL" we could do:
e = 1 | hash(URL) | 1 # we concatenate a 1 bit at the start to make sure all exponents are of equal length, and at the end to make sure the exponent is odd
d = e^-1 % phi(N)
signature = (nonce^d % N, URL)

Obviously I don't have a security proof, but it "seems" secure, right? Hope this helps :-)

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.