Giter VIP home page Giter VIP logo

pb-exercises's Issues

Use of secrets module instead of random module

The use of random is not recommended for cryptographic or security purposes.

Warning The pseudo-random generators of this module should not be used for security purposes. For security or cryptographic uses, see the secrets module.

Reference: https://docs.python.org/3/library/random.html (Red Box warning)

If the project wants to use random for legacy reasons, it should atleast be mentioned that it is insecure. If this is mentioned elsewhere in the book, please close the issue.

Issue installing pycrypto: 'gmp.h' file not found

Was getting this error in the pip install -r requirements.txt step

      src/_fastmath.c:36:11: fatal error: 'gmp.h' file not found
      # include <gmp.h>
                ^~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pycrypto
  Running setup.py clean for pycrypto
Failed to build pycrypto
Installing collected packages: pycrypto
  Running setup.py install for pycrypto ... error
  error: subprocess-exited-with-error

Turns out I was able to prepend the install command like this, which then made it work:

env "CFLAGS=-I/usr/local/include -L/usr/local/lib" pip install -r requirements.txt

HELP Chapter 3 Exercise 1

Здравствуйте, не знал куда написать, пишу сюда, по поводу выполнения упражнения 1 в главе 3, выдает ошибку PS C:\Users\banda> & C:/Users/banda/AppData/Local/Programs/ Python/Python39/python.exe c:/Users/banda/Desktop/PY3/main.py Возврат
(последний последний вызов):
Файл «c:\Users\banda\Desktop\PY3\main.py», строка 109, в
print(on_curve(Элемент поля(192, простое число), Элемент поля(105, простое число)))
Файл "c:\Users\banda\Desktop\PY3\main.py ", строка 108, в on_curve
return y 2 == x 3 + a*x +b
Ошибка типа: Неподдерживаемые типы операндов для *: «Элемент поля» и «Элемент поля».
Я вставил код, опубликованный на Github, ошибка сохраняется.
PS буду рад оказанной помощи

from ecc import FieldElement
prime = 223
a = FieldElement(0, prime)
b = FieldElement(7, prime)
def on_curve(x,y):
... return y 2 == x 3 + a*x + b
print(on_curve (FieldElement(192, простое), FieldElement(105, простое)))
True
print(on_curve(FieldElement(17, простое), FieldElement(56, простое)))
True
print(on_curve(FieldElement(200, простое), FieldElement( 119, штрих)))
Ложь
print(on_curve(FieldElement(1, штрих), FieldElement(193, штрих)))
True
print(on_curve(FieldElement(42, штрих), FieldElement(99, штрих)))
False

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.