Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #22570

Re: simple rsa from javascript to python

From Nobody <nobody@nowhere.com>
Subject Re: simple rsa from javascript to python
Date 2012-04-03 06:12 +0100
Message-Id <pan.2012.04.03.05.13.10.252000@nowhere.com>
Newsgroups comp.lang.python
References <2aaac386-2223-4f70-aee5-a584dba5199a@r2g2000pbs.googlegroups.com>
Organization Zen Internet

Show all headers | View raw


On Mon, 02 Apr 2012 16:19:05 -0700, Astan Chee wrote:

> and I'm trying to convert this into python and I'm rather stuck with
> pycrypto as there is no example on how to make the public key with a mod
> and exponent (or I've probably missed it).

from Crypto.PublicKey import RSA
mod = long("B99808B881F3D8A...", 16)  # truncated for clarity
exp = long("010001", 16)
rsa = RSA.construct((mod, exp))

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

simple rsa from javascript to python Astan Chee <astan.chee@gmail.com> - 2012-04-02 16:19 -0700
  Re: simple rsa from javascript to python Nobody <nobody@nowhere.com> - 2012-04-03 06:12 +0100

csiph-web