Skip to content

SecureRandom is not secure #1

@rchatterjee

Description

@rchatterjee

In this file,
pythia/django/pythiaPrfService/crypto.py

return str(b64encode(os.urandom(n))[:n])

The output of secureRandom is not n byte random number. It is 3/4 * n bytes random number. Because after encoding in b64encoding the output string is bigger than n byte, which is being truncated here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions