Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

314
Views
obtener D negativo, cuando intento generar una clave privada RSA

Tengo el método para calcular D (clave privada) para RSA. El método utiliza un algoritmo euclidiano extendido. Entonces, a veces obtengo una D negativa y no está bien, ¿cómo puedo solucionarlo? D * e mod (p-1)(q-1)=1; aqui esta el codigo del metodo

 public static BigInteger extEuclid(BigInteger a, BigInteger b) { BigInteger x = BigInteger.ZERO, y = BigInteger.ONE, lastx = BigInteger.ONE, lasty = BigInteger.ZERO, temp; while (!b.equals(BigInteger.ZERO)) { BigInteger q = a.divide(b); BigInteger r = a.mod(b) ; a = b; b = r; temp = x; x = lastx.subtract(q.multiply(x)); lastx = temp; temp = y; y = lasty.subtract(q.multiply(y)); lasty = temp; } return lastx; } public void calcD(){ d = extEuclid(e, fEuler); }
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!