python-crypto.scm 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
  3. ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
  4. ;;; Copyright © 2015, 2016, 2017, 2019 Leo Famulari <leo@famulari.name>
  5. ;;; Copyright © 2016, 2017, 2020 Marius Bakke <mbakke@fastmail.com>
  6. ;;; Copyright © 2017 Ben Sturmfels <ben@sturm.com.au>
  7. ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
  8. ;;; Copyright © 2015 Cyril Roelandt <tipecaml@gmail.com>
  9. ;;; Copyright © 2014, 2017 Eric Bavier <bavier@member.fsf.org>
  10. ;;; Copyright © 2015, 2016 David Thompson <davet@gnu.org>
  11. ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
  12. ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
  13. ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
  14. ;;; Copyright © 2015, 2016, 2017, 2019 Ricardo Wurmus <rekado@elephly.net>
  15. ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
  16. ;;; Copyright © 2016, 2017, 2020 Arun Isaac <arunisaac@systemreboot.net>
  17. ;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
  18. ;;; Copyright © 2018 Tomáš Čech <sleep_walker@gnu.org>
  19. ;;; Copyright © 2018, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
  20. ;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
  21. ;;; Copyright © 2018 Nam Nguyen <namn@berkeley.edu>
  22. ;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
  23. ;;; Copyright © 2019 Clément Lassieur <clement@lassieur.org>
  24. ;;; Copyright © 2020 Alexandros Theodotou <alex@zrythm.org>
  25. ;;; Copyright © 2020 Justus Winter <justus@sequoia-pgp.org>
  26. ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
  27. ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  28. ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
  29. ;;;
  30. ;;; This file is part of GNU Guix.
  31. ;;;
  32. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  33. ;;; under the terms of the GNU General Public License as published by
  34. ;;; the Free Software Foundation; either version 3 of the License, or (at
  35. ;;; your option) any later version.
  36. ;;;
  37. ;;; GNU Guix is distributed in the hope that it will be useful, but
  38. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  39. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  40. ;;; GNU General Public License for more details.
  41. ;;;
  42. ;;; You should have received a copy of the GNU General Public License
  43. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  44. (define-module (gnu packages python-crypto)
  45. #:use-module (guix packages)
  46. #:use-module (guix download)
  47. #:use-module (guix gexp)
  48. #:use-module (guix git-download)
  49. #:use-module (guix build-system python)
  50. #:use-module (gnu packages)
  51. #:use-module (gnu packages check)
  52. #:use-module (gnu packages crypto)
  53. #:use-module (gnu packages kerberos)
  54. #:use-module (gnu packages libffi)
  55. #:use-module (gnu packages multiprecision)
  56. #:use-module (gnu packages password-utils)
  57. #:use-module (gnu packages protobuf)
  58. #:use-module (gnu packages python)
  59. #:use-module (gnu packages python-build)
  60. #:use-module (gnu packages python-check)
  61. #:use-module (gnu packages python-compression)
  62. #:use-module (gnu packages python-web)
  63. #:use-module (gnu packages python-xyz)
  64. #:use-module (gnu packages swig)
  65. #:use-module (gnu packages time)
  66. #:use-module (gnu packages tls)
  67. #:use-module (gnu packages xml)
  68. #:use-module ((guix licenses) #:prefix license:)
  69. #:use-module (srfi srfi-1))
  70. (define-public python-potr
  71. (package
  72. (name "python-potr")
  73. (version "1.0.2")
  74. (source
  75. (origin
  76. (method git-fetch)
  77. (uri
  78. (git-reference
  79. (url "https://github.com/python-otr/pure-python-otr")
  80. (commit version)))
  81. (file-name
  82. (git-file-name name version))
  83. (sha256
  84. (base32 "1hzw6h01fm216nmipyylgz0zybd80w1xsk12m7djycnhqrnrvvv1"))))
  85. (build-system python-build-system)
  86. (propagated-inputs
  87. `(("python-pycrypto" ,python-pycrypto)))
  88. (synopsis "Python OTR Implementation")
  89. (description "Python OTR is an Off-The-Record Protocol Implementation in
  90. Python. It does not bind to libotr.")
  91. (home-page "https://github.com/python-otr/pure-python-otr")
  92. (license license:lgpl3+)))
  93. (define-public python-base58
  94. (package
  95. (name "python-base58")
  96. (version "2.0.1")
  97. (source
  98. (origin
  99. (method url-fetch)
  100. (uri (pypi-uri "base58" version))
  101. (sha256
  102. (base32
  103. "0yfaqp76kbdb62hikr5n4jkkfjfmii89grwfy6sw3fmsv5hrap1n"))))
  104. (build-system python-build-system)
  105. (native-inputs
  106. `(("python-pyhamcrest" ,python-pyhamcrest)))
  107. (home-page "https://github.com/keis/base58")
  108. (synopsis "Base58 and Base58Check implementation")
  109. (description "Base58 and Base58Check implementation compatible
  110. with what is used by the Bitcoin network.")
  111. (license license:expat)))
  112. (define-public python-bcrypt
  113. (package
  114. (name "python-bcrypt")
  115. (version "3.2.0")
  116. (source
  117. (origin
  118. (method url-fetch)
  119. (uri (pypi-uri "bcrypt" version))
  120. (sha256
  121. (base32 "0agvzdn7r7jx5y4scl5gjmrmr6njvizwmr9n7h1kmaahdrrc34sv"))))
  122. (build-system python-build-system)
  123. (native-inputs
  124. `(("python-pycparser" ,python-pycparser)
  125. ("python-pytest" ,python-pytest)))
  126. (propagated-inputs
  127. `(("python-cffi" ,python-cffi)
  128. ("python-six" ,python-six)))
  129. (home-page "https://github.com/pyca/bcrypt/")
  130. (synopsis
  131. "Modern password hashing library")
  132. (description
  133. "Bcrypt is a Python module which provides a password hashing method based
  134. on the Blowfish password hashing algorithm, as described in
  135. @url{http://static.usenix.org/events/usenix99/provos.html,\"A Future-Adaptable
  136. Password Scheme\"} by Niels Provos and David Mazieres.")
  137. (license license:asl2.0)))
  138. (define-public python-passlib
  139. (package
  140. (name "python-passlib")
  141. (version "1.7.4")
  142. (source
  143. (origin
  144. (method url-fetch)
  145. (uri (pypi-uri "passlib" version))
  146. (sha256
  147. (base32 "015y5qaw9qnxr29lg60dml1g5rbqd4586wy5n8m41ib55gvm1zfy"))))
  148. (build-system python-build-system)
  149. (native-inputs
  150. `(("python-nose" ,python-nose)))
  151. (propagated-inputs
  152. `(("python-py-bcrypt" ,python-py-bcrypt)))
  153. (arguments
  154. `(#:phases
  155. (modify-phases %standard-phases
  156. (add-before 'check 'set-PYTHON_EGG_CACHE
  157. ;; Some tests require access to "$HOME/.cython".
  158. (lambda _ (setenv "PYTHON_EGG_CACHE" "/tmp") #t)))))
  159. (home-page "https://bitbucket.org/ecollins/passlib")
  160. (synopsis "Comprehensive password hashing framework")
  161. (description
  162. "Passlib is a password hashing library for Python 2 & 3, which provides
  163. cross-platform implementations of over 30 password hashing algorithms, as well
  164. as a framework for managing existing password hashes. It's designed to be
  165. useful for a wide range of tasks, from verifying a hash found in /etc/shadow,
  166. to providing full-strength password hashing for multi-user application.")
  167. (license license:bsd-3)))
  168. (define-public python2-passlib
  169. (package-with-python2 python-passlib))
  170. (define-public python-py-bcrypt
  171. (package
  172. (name "python-py-bcrypt")
  173. (version "0.4")
  174. (source
  175. (origin
  176. (method url-fetch)
  177. (uri (pypi-uri "py-bcrypt" version))
  178. (sha256
  179. (base32
  180. "0y6smdggwi5s72v6p1nn53dg6w05hna3d264cq6kas0lap73p8az"))))
  181. (build-system python-build-system)
  182. (home-page "https://code.google.com/p/py-bcrypt")
  183. (synopsis
  184. "Bcrypt password hashing and key derivation")
  185. (description
  186. "A python wrapper of OpenBSD's Blowfish password hashing code. This
  187. system hashes passwords using a version of Bruce Schneier's Blowfish block
  188. cipher with modifications designed to raise the cost of off-line password
  189. cracking and frustrate fast hardware implementation. The computation cost of
  190. the algorithm is parametrised, so it can be increased as computers get faster.
  191. The intent is to make a compromise of a password database less likely to
  192. result in an attacker gaining knowledge of the plaintext passwords (e.g. using
  193. John the Ripper).")
  194. ;; "sha2.c" is under BSD-3;
  195. ;; "blowfish.c" and "bcrypt.c" are under BSD-4;
  196. ;; the rest is under ISC.
  197. (license (list license:isc license:bsd-3 license:bsd-4))))
  198. (define-public python2-py-bcrypt
  199. (package-with-python2 python-py-bcrypt))
  200. (define-public python-pyblake2
  201. (package
  202. (name "python-pyblake2")
  203. (version "1.1.2")
  204. (source
  205. (origin
  206. (method url-fetch)
  207. (uri (pypi-uri "pyblake2" version))
  208. (sha256
  209. (base32
  210. "0gz9hgznv5zw4qjq43xa56y0yikimx30gffvibxzm0nv5sq7xk2w"))))
  211. (build-system python-build-system)
  212. (home-page "https://github.com/dchest/pyblake2")
  213. (synopsis "BLAKE2 hash function for Python")
  214. (description "BLAKE2 is a cryptographic hash function, which offers
  215. stronger security while being as fast as MD5 or SHA-1, and comes in two
  216. flavors: @code{BLAKE2b}, optimized for 64-bit platforms and produces digests
  217. of any size between 1 and 64 bytes, and @code{BLAKE2s}, optimized for 8- to
  218. 32-bit platforms and produces digests of any size between 1 and 32 bytes.
  219. This package provides a Python interface for BLAKE2.")
  220. ;; The COPYING file declares it as public domain, with the option to
  221. ;; alternatively use and redistribute it under a variety of permissive
  222. ;; licenses. cc0 is explicitly mentioned in setup.py and pyblake2module.c.
  223. (license (list license:public-domain license:cc0))))
  224. (define-public python-paramiko
  225. (package
  226. (name "python-paramiko")
  227. (version "2.7.2")
  228. (source
  229. (origin
  230. (method url-fetch)
  231. (uri (pypi-uri "paramiko" version))
  232. (sha256
  233. (base32 "0dahwq623jnna7gsr9j0mkwr9k2n1pvkapjryhcx508d5jxg8dkz"))))
  234. (build-system python-build-system)
  235. (arguments
  236. `(;; FIXME: Tests require many unpackaged libraries, see dev-requirements.txt.
  237. #:tests? #f))
  238. (propagated-inputs
  239. `(("python-bcrypt" ,python-bcrypt)
  240. ("python-pyasn1" ,python-pyasn1)
  241. ("python-pynacl" ,python-pynacl)
  242. ("python-cryptography" ,python-cryptography)))
  243. (home-page "https://www.paramiko.org/")
  244. (synopsis "SSHv2 protocol library")
  245. (description "Paramiko is a python implementation of the SSHv2 protocol,
  246. providing both client and server functionality. While it leverages a Python C
  247. extension for low level cryptography (PyCrypto), Paramiko itself is a pure
  248. Python interface around SSH networking concepts.")
  249. (license license:lgpl2.1+)))
  250. (define-public python-ecdsa
  251. (package
  252. (name "python-ecdsa")
  253. (version "0.14.1")
  254. (source
  255. (origin
  256. (method url-fetch)
  257. (uri (pypi-uri "ecdsa" version))
  258. (sha256
  259. (base32 "13nx5cbfxc0gnax5zwdmp9xc40qd1llk62mv85jyrvqkbw017ik4"))))
  260. (build-system python-build-system)
  261. (arguments
  262. '(#:phases
  263. (modify-phases %standard-phases
  264. (replace 'check
  265. (lambda _ (invoke "pytest"))))))
  266. (propagated-inputs
  267. `(("python-six" ,python-six)))
  268. (native-inputs
  269. `(("openssl" ,openssl)
  270. ("python-pytest" ,python-pytest)))
  271. (home-page "https://github.com/warner/python-ecdsa")
  272. (synopsis "ECDSA cryptographic signature library (pure python)")
  273. (description
  274. "This is an easy-to-use implementation of ECDSA cryptography (Elliptic
  275. Curve Digital Signature Algorithm), implemented purely in Python. With this
  276. library, you can quickly create key pairs (signing key and verifying key), sign
  277. messages, and verify the signatures. The keys and signatures are very short,
  278. making them easy to handle and incorporate into other protocols.")
  279. (license license:expat)))
  280. (define-public python2-ecdsa
  281. (package-with-python2 python-ecdsa))
  282. ;;; Pycrypto is abandoned upstream:
  283. ;;;
  284. ;;; https://github.com/dlitz/pycrypto/issues/173
  285. ;;;
  286. ;;; TODO Remove this package from GNU Guix.
  287. (define-public python-pycrypto
  288. (package
  289. (name "python-pycrypto")
  290. (version "2.6.1")
  291. (source
  292. (origin
  293. (method url-fetch)
  294. (uri (pypi-uri "pycrypto" version))
  295. (patches (search-patches "python-pycrypto-CVE-2013-7459.patch"
  296. "python-pycrypto-time-clock.patch"))
  297. (sha256
  298. (base32
  299. "0g0ayql5b9mkjam8hym6zyg6bv77lbh66rv1fyvgqb17kfc1xkpj"))))
  300. (build-system python-build-system)
  301. (inputs
  302. `(("python" ,python)
  303. ("gmp" ,gmp)))
  304. (arguments
  305. `(#:phases
  306. (modify-phases %standard-phases
  307. (add-before 'build 'set-build-env
  308. ;; pycrypto runs an autoconf configure script behind the scenes
  309. (lambda _ (setenv "CONFIG_SHELL" (which "bash")) #t)))))
  310. (home-page "https://www.dlitz.net/software/pycrypto/")
  311. (synopsis "Cryptographic modules for Python")
  312. (description
  313. "Pycrypto is a collection of both secure hash functions (such as SHA256
  314. and RIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal,
  315. etc.). The package is structured to make adding new modules easy.")
  316. (license license:public-domain)))
  317. (define-public python2-pycrypto
  318. (let ((pycrypto (package-with-python2 python-pycrypto)))
  319. (package/inherit pycrypto
  320. (inputs
  321. `(("python" ,python-2)
  322. ,@(alist-delete
  323. "python"
  324. (package-inputs pycrypto)))))))
  325. (define-public python-kerberos
  326. (package
  327. (name "python-kerberos")
  328. (version "1.3.0")
  329. (source
  330. (origin
  331. (method url-fetch)
  332. (uri (pypi-uri "kerberos" version))
  333. (sha256
  334. (base32
  335. "19663qxmma0i8bfbjc2iwy5hgq0g4pfb75r023v5dps68zfvffgh"))))
  336. (build-system python-build-system)
  337. (inputs
  338. `(("mit-krb5" ,mit-krb5)))
  339. (home-page "https://github.com/apple/ccs-pykerberos")
  340. (synopsis
  341. "Python Kerberos library used by CalendarServer")
  342. (description
  343. "This Python package is a high-level wrapper for Kerberos (GSSAPI)
  344. operations. The goal is to avoid having to build a module that wraps the
  345. entire Kerberos.framework, and instead offer a limited set of functions that
  346. do what is needed for client/server Kerberos authentication based on
  347. <http://www.ietf.org/rfc/rfc4559.txt>.")
  348. (license license:asl2.0)))
  349. (define-public python-keyring
  350. (package
  351. (name "python-keyring")
  352. (version "22.0.1")
  353. (source
  354. (origin
  355. (method url-fetch)
  356. (uri (pypi-uri "keyring" version))
  357. (sha256
  358. (base32
  359. "1pvqc6may03did0iz98gasg7cy4h8ljzs4ibh927bfzda8a3xjws"))))
  360. (build-system python-build-system)
  361. (arguments
  362. `(#:phases
  363. (modify-phases %standard-phases
  364. (replace 'check
  365. (lambda* (#:key tests? #:allow-other-keys)
  366. (when tests?
  367. (invoke "pytest"))
  368. #t)))))
  369. (native-inputs
  370. `(("python-toml" ,python-toml)
  371. ("python-pytest" ,python-pytest)
  372. ("python-pytest-checkdocs" ,python-pytest-checkdocs)
  373. ("python-pytest-cov" ,python-pytest-cov)
  374. ("python-pytest-flake8" ,python-pytest-flake8)
  375. ("python-setuptools" ,python-setuptools)
  376. ("python-setuptools-scm" ,python-setuptools-scm)))
  377. (propagated-inputs
  378. `(("python-secretstorage" ,python-secretstorage)))
  379. (home-page "https://github.com/jaraco/keyring")
  380. (synopsis "Store and access your passwords safely")
  381. (description
  382. "The Python keyring lib provides a easy way to access the system keyring
  383. service from python. It can be used in any application that needs safe
  384. password storage.")
  385. ;; "MIT" and PSF dual license
  386. (properties `((python2-variant . ,(delay python2-keyring))))
  387. (license license:x11)))
  388. (define-public python2-keyring
  389. (let ((keyring (package-with-python2
  390. (strip-python2-variant python-keyring))))
  391. (package
  392. (inherit keyring)
  393. (name "python2-keyring")
  394. (version "8.7")
  395. (source
  396. (origin
  397. (method url-fetch)
  398. (uri (pypi-uri "keyring" version))
  399. (sha256
  400. (base32
  401. "0482rmi2x6p78wl2kz8qzyq21xz1sbbfwnv5x7dggar4vkwxhzfx"))))
  402. (arguments
  403. `(#:python ,python-2))
  404. (native-inputs
  405. `(("python2-pytest" ,python2-pytest)
  406. ("python2-pytest-runner" ,python2-pytest-runner)
  407. ("python2-setuptools-scm" ,python2-setuptools-scm)))
  408. (propagated-inputs
  409. `(("python2-pycrypto" ,python2-pycrypto))))))
  410. (define-public python-keyrings.alt
  411. (package
  412. (name "python-keyrings.alt")
  413. (version "3.4.0")
  414. (source
  415. (origin
  416. (method url-fetch)
  417. (uri (pypi-uri "keyrings.alt" version))
  418. (sha256
  419. (base32
  420. "0gdjdqpq2hf770p6iwi891mil0vbsdhvy88x0v8b2w4y4b28lcli"))
  421. (modules '((guix build utils)))
  422. (snippet
  423. '(begin
  424. (delete-file "keyrings/alt/_win_crypto.py")
  425. ;; Rely on python-keyring>20:
  426. ;; https://github.com/jaraco/keyrings.alt/issues/33
  427. (substitute* '("keyrings/alt/tests/test_Gnome.py"
  428. "keyrings/alt/tests/test_Google.py"
  429. "keyrings/alt/tests/test_Windows.py"
  430. "keyrings/alt/tests/test_file.py"
  431. "keyrings/alt/tests/test_pyfs.py")
  432. (("keyring.tests.test_backend") "keyring.testing.backend")
  433. (("keyring.tests.util") "keyring.testing.util"))
  434. #t))))
  435. (build-system python-build-system)
  436. (native-inputs
  437. `(("python-keyring" ,python-keyring)
  438. ("python-pytest" ,python-pytest)
  439. ("python-setuptools-scm" ,python-setuptools-scm)))
  440. (home-page "https://github.com/jaraco/keyrings.alt")
  441. (synopsis "Alternate keyring implementations")
  442. (description "Keyrings in this package may have security risks or other
  443. implications. These backends were extracted from the main keyring project to
  444. make them available for those who wish to employ them, but are discouraged for
  445. general production use. Include this module and use its backends at your own
  446. risk.")
  447. (license license:expat)))
  448. (define-public python-certauth
  449. (package
  450. (name "python-certauth")
  451. (version "1.3.0")
  452. (source
  453. (origin
  454. (method url-fetch)
  455. (uri (pypi-uri "certauth" version))
  456. (sha256
  457. (base32
  458. "1yxqfb5131wahjyw9pxz03bq476rcfx62s6k53xx4cqbzzgdaqkq"))))
  459. (build-system python-build-system)
  460. (propagated-inputs
  461. `(("python-pyopenssl" ,python-pyopenssl)
  462. ("python-tldextract" ,python-tldextract)))
  463. (native-inputs
  464. `(("python-pytest-cov" ,python-pytest-cov)))
  465. (home-page "https://github.com/ikreymer/certauth")
  466. (synopsis "Certificate authority creation tool")
  467. (description "This package provides a small library, built on top of
  468. pyOpenSSL, which allows for creating a custom certificate authority (CA)
  469. certificate, and generating on-demand dynamic host certs using that CA
  470. certificate. It is most useful for use with a man-in-the-middle HTTPS proxy,
  471. for example, for recording or replaying web content.")
  472. (license license:expat)))
  473. (define-public python-certifi
  474. (package
  475. (name "python-certifi")
  476. (version "2020.12.5")
  477. (source (origin
  478. (method url-fetch)
  479. (uri (pypi-uri "certifi" version))
  480. (sha256
  481. (base32
  482. "177mdbw0livdjvp17sz6wsfrc32838m9y59v871gpgv2888raj8s"))))
  483. (build-system python-build-system)
  484. (arguments '(#:tests? #f)) ;no tests
  485. (home-page "https://certifi.io/")
  486. (synopsis "Python CA certificate bundle")
  487. (description
  488. "Certifi is a Python library that contains a CA certificate bundle, which
  489. is used by the Requests library to verify HTTPS requests.")
  490. (license license:asl2.0)))
  491. (define-public python2-certifi
  492. (package-with-python2 python-certifi))
  493. (define-public python-cryptography-vectors
  494. (package
  495. (name "python-cryptography-vectors")
  496. (version "3.3.1")
  497. (source
  498. (origin
  499. (method url-fetch)
  500. (uri (pypi-uri "cryptography_vectors" version))
  501. (sha256
  502. (base32
  503. "192wix3sr678x21brav5hgc6j93l7ab1kh69p2scr3fsblq9qy03"))))
  504. (build-system python-build-system)
  505. (home-page "https://github.com/pyca/cryptography")
  506. (synopsis "Test vectors for the cryptography package")
  507. (description
  508. "This package contains test vectors for the cryptography package.")
  509. ;; Distributed under either BSD-3 or ASL2.0
  510. (license (list license:bsd-3 license:asl2.0))))
  511. (define-public python2-cryptography-vectors
  512. (package-with-python2 python-cryptography-vectors))
  513. (define-public python-cryptography
  514. (package
  515. (name "python-cryptography")
  516. (version "3.3.1")
  517. (source
  518. (origin
  519. (method url-fetch)
  520. (uri (pypi-uri "cryptography" version))
  521. (sha256
  522. (base32
  523. "1ribd1vxq9wwz564mg60dzcy699gng54admihjjkgs9dx95pw5vy"))))
  524. (build-system python-build-system)
  525. (inputs
  526. `(("openssl" ,openssl)))
  527. (propagated-inputs
  528. `(("python-asn1crypto" ,python-asn1crypto)
  529. ("python-cffi" ,python-cffi)
  530. ("python-six" ,python-six)
  531. ("python-idna" ,python-idna)
  532. ("python-iso8601" ,python-iso8601)))
  533. (native-inputs
  534. `(("python-cryptography-vectors" ,python-cryptography-vectors)
  535. ("python-hypothesis" ,python-hypothesis)
  536. ("python-pretend" ,python-pretend)
  537. ("python-pytz" ,python-pytz)
  538. ("python-pytest" ,python-pytest)))
  539. (home-page "https://github.com/pyca/cryptography")
  540. (synopsis "Cryptographic recipes and primitives for Python")
  541. (description
  542. "cryptography is a package which provides cryptographic recipes and
  543. primitives to Python developers. It aims to be the “cryptographic standard
  544. library” for Python. The package includes both high level recipes, and low
  545. level interfaces to common cryptographic algorithms such as symmetric ciphers,
  546. message digests and key derivation functions.")
  547. ;; Distributed under either BSD-3 or ASL2.0
  548. (license (list license:bsd-3 license:asl2.0))
  549. (properties `((python2-variant . ,(delay python2-cryptography))))))
  550. (define-public python2-cryptography
  551. (let ((crypto (package-with-python2
  552. (strip-python2-variant python-cryptography))))
  553. (package/inherit crypto
  554. (propagated-inputs
  555. `(("python2-ipaddress" ,python2-ipaddress)
  556. ("python2-backport-ssl-match-hostname"
  557. ,python2-backport-ssl-match-hostname)
  558. ("python2-enum34" ,python2-enum34)
  559. ,@(package-propagated-inputs crypto))))))
  560. (define-public python-pyopenssl
  561. (package
  562. (name "python-pyopenssl")
  563. (version "20.0.1")
  564. (source
  565. (origin
  566. (method url-fetch)
  567. (uri (pypi-uri "pyOpenSSL" version))
  568. (sha256
  569. (base32
  570. "0labcbh2g0jhgisd79wx9kixmi6fip28096d1xb05fj3jmsiq8sc"))))
  571. (build-system python-build-system)
  572. (arguments
  573. '(#:phases
  574. (modify-phases %standard-phases
  575. (delete 'check)
  576. (add-after 'install 'check
  577. (lambda* (#:key inputs outputs #:allow-other-keys)
  578. (add-installed-pythonpath inputs outputs)
  579. ;; PyOpenSSL runs tests against a certificate with a fixed
  580. ;; expiry time. To ensure successful builds in the future,
  581. ;; set the time to roughly the release date.
  582. (invoke "faketime" "2021-05-01" "py.test" "-v" "-k"
  583. (string-append
  584. ;; This test tries to look up certificates from
  585. ;; the compiled-in default path in OpenSSL, which
  586. ;; does not exist in the build environment.
  587. "not test_fallback_default_verify_paths "
  588. ;; This test attempts to make a connection to
  589. ;; an external web service.
  590. "and not test_set_default_verify_paths "
  591. ;; Fails on i686-linux and possibly other 32-bit platforms
  592. ;; https://github.com/pyca/pyopenssl/issues/974
  593. "and not test_verify_with_time")))))))
  594. (propagated-inputs
  595. `(("python-cryptography" ,python-cryptography)
  596. ("python-six" ,python-six)))
  597. (inputs
  598. `(("openssl" ,openssl)))
  599. (native-inputs
  600. `(("libfaketime" ,libfaketime)
  601. ("python-flaky" ,python-flaky)
  602. ("python-pretend" ,python-pretend)
  603. ("python-pytest" ,python-pytest)))
  604. (home-page "https://github.com/pyca/pyopenssl")
  605. (synopsis "Python wrapper module around the OpenSSL library")
  606. (description
  607. "PyOpenSSL is a high-level wrapper around a subset of the OpenSSL
  608. library.")
  609. (license license:asl2.0)))
  610. (define-public python2-pyopenssl
  611. (package-with-python2 python-pyopenssl))
  612. (define-public python-ed25519
  613. (package
  614. (name "python-ed25519")
  615. (version "1.4")
  616. (source
  617. (origin
  618. (method url-fetch)
  619. (uri (pypi-uri "ed25519" version))
  620. (sha256
  621. (base32
  622. "0ahx1nkxa0xis3cw0h5c4fpgv8mq4znkq7kajly33lc3317bk499"))))
  623. (build-system python-build-system)
  624. (home-page "https://github.com/warner/python-ed25519")
  625. (synopsis "Ed25519 public-key signatures")
  626. (description "Ed25519 public-key signatures")
  627. (license license:expat)))
  628. (define-public python2-ed25519
  629. (package-with-python2 python-ed25519))
  630. (define-public python-axolotl-curve25519
  631. (package
  632. (name "python-axolotl-curve25519")
  633. (version "0.4.1.post2")
  634. (source
  635. (origin
  636. (method url-fetch)
  637. (uri (pypi-uri "python-axolotl-curve25519" version))
  638. (sha256
  639. (base32
  640. "18v3rfyv7xi26fb97nw1xc0l6x8wi0i4xj8dlq4gblpbjxiac187"))))
  641. (build-system python-build-system)
  642. (home-page "https://github.com/tgalal/python-axolotl-curve25519")
  643. (synopsis "Python wrapper for curve25519 library")
  644. (description "This is a python wrapper for the curve25519 library
  645. with ed25519 signatures. The C code was pulled from
  646. libaxolotl-android. At the moment this wrapper is meant for use by
  647. python-axolotl.")
  648. (license (list license:gpl3 ; Most files
  649. license:bsd-3)))) ; curve/curve25519-donna.c
  650. (define-public python2-axolotl-curve25519
  651. (package-with-python2 python-axolotl-curve25519))
  652. (define-public python-axolotl
  653. (package
  654. (name "python-axolotl")
  655. (version "0.2.3")
  656. (source
  657. (origin
  658. (method url-fetch)
  659. (uri (pypi-uri "python-axolotl" version))
  660. (sha256
  661. (base32
  662. "1bwdp24fmriffwx91aigs9k162albb51iskp23nc939z893q23py"))))
  663. (build-system python-build-system)
  664. (arguments
  665. `(#:phases
  666. (modify-phases %standard-phases
  667. ;; Don't install tests
  668. (add-before 'install 'remove-tests
  669. (lambda _
  670. (for-each delete-file-recursively
  671. '("axolotl/tests" "build/lib/axolotl/tests"))
  672. #t)))))
  673. (propagated-inputs
  674. `(("python-axolotl-curve25519" ,python-axolotl-curve25519)
  675. ("python-cryptography" ,python-cryptography)
  676. ("python-protobuf" ,python-protobuf)))
  677. (home-page "https://github.com/tgalal/python-axolotl")
  678. (synopsis "Python port of libaxolotl-android")
  679. (description "This is a python port of libaxolotl-android. This
  680. is a ratcheting forward secrecy protocol that works in synchronous and
  681. asynchronous messaging environments.")
  682. (license license:gpl3)))
  683. (define-public python2-axolotl
  684. (package-with-python2 python-axolotl))
  685. ;; SlowAES isn't compatible with Python 3.
  686. (define-public python2-slowaes
  687. (package
  688. (name "python2-slowaes")
  689. (version "0.1a1")
  690. (source
  691. (origin
  692. (method url-fetch)
  693. (uri (pypi-uri "slowaes" version))
  694. (sha256
  695. (base32
  696. "02dzajm83a7lqgxf6r3hgj64wfmcxz8gs4nvgxpvj5n19kjqlrc3"))))
  697. (build-system python-build-system)
  698. (arguments `(#:python ,python-2))
  699. (home-page "http://code.google.com/p/slowaes/")
  700. (synopsis "Implementation of AES in Python")
  701. (description "This package contains an implementation of AES in Python.
  702. This implementation is slow (hence the project name) but still useful when
  703. faster ones are not available.")
  704. (license license:asl2.0)))
  705. (define-public python-pyaes
  706. (package
  707. (name "python-pyaes")
  708. (version "1.6.1")
  709. (source
  710. (origin
  711. (method url-fetch)
  712. (uri (pypi-uri "pyaes" version))
  713. (sha256
  714. (base32
  715. "13vdaff15k0jyfcss4b4xvfgm8xyv0nrbyw5n1qc7lrqbi0b3h82"))))
  716. (build-system python-build-system)
  717. (home-page "https://github.com/ricmoo/pyaes")
  718. (synopsis "Implementation of AES in Python")
  719. (description "This package contains a pure-Python implementation of the
  720. AES block cipher algorithm and the common modes of operation (CBC, CFB, CTR,
  721. ECB and OFB).")
  722. (license license:expat)))
  723. (define-public python2-pyaes
  724. (package-with-python2 python-pyaes))
  725. (define-public python-asn1crypto
  726. (package
  727. (name "python-asn1crypto")
  728. (version "1.4.0")
  729. (source
  730. (origin
  731. (method git-fetch)
  732. (uri (git-reference
  733. (url "https://github.com/wbond/asn1crypto")
  734. (commit version)))
  735. (file-name (git-file-name name version))
  736. (sha256
  737. (base32
  738. "19abibn6jw20mzi1ln4n9jjvpdka8ygm4m439hplyrdfqbvgm01r"))))
  739. (build-system python-build-system)
  740. (arguments
  741. '(#:phases (modify-phases %standard-phases
  742. (replace 'check
  743. (lambda _
  744. (invoke "python" "run.py" "tests"))))))
  745. (home-page "https://github.com/wbond/asn1crypto")
  746. (synopsis "ASN.1 parser and serializer in Python")
  747. (description "asn1crypto is an ASN.1 parser and serializer with definitions
  748. for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7,
  749. PKCS#8, PKCS#12, PKCS#5, X.509 and TSP.")
  750. (license license:expat)))
  751. (define-public python2-asn1crypto
  752. (package-with-python2 python-asn1crypto))
  753. (define-public python-pynacl
  754. (package
  755. (name "python-pynacl")
  756. (version "1.4.0")
  757. (source
  758. (origin
  759. (method url-fetch)
  760. (uri (pypi-uri "PyNaCl" version))
  761. (modules '((guix build utils)))
  762. (snippet
  763. '(begin
  764. ;; Remove spurious dependency on python-wheel, can be removed
  765. ;; for 1.5.
  766. (substitute* "setup.py"
  767. (("\"wheel\"") ""))
  768. ;; Remove bundled libsodium.
  769. (delete-file-recursively "src/libsodium")))
  770. (sha256
  771. (base32
  772. "01b56hxrbif3hx8l6rwz5kljrgvlbj7shmmd2rjh0hn7974a5sal"))))
  773. (build-system python-build-system)
  774. (arguments
  775. `(#:phases
  776. (modify-phases %standard-phases
  777. (add-before 'build 'use-system-sodium
  778. (lambda _
  779. (setenv "SODIUM_INSTALL" "system")))
  780. (replace 'check
  781. (lambda _
  782. (invoke "pytest" "-vv"))))))
  783. (native-inputs
  784. `(("python-hypothesis" ,python-hypothesis)
  785. ("python-pytest" ,python-pytest)))
  786. (propagated-inputs
  787. `(("python-cffi" ,python-cffi)
  788. ("python-six" ,python-six)
  789. ("libsodium" ,libsodium)))
  790. (home-page "https://github.com/pyca/pynacl/")
  791. (synopsis "Python bindings to libsodium")
  792. (description
  793. "PyNaCl is a Python binding to libsodium, which is a fork of the
  794. Networking and Cryptography library. These libraries have a stated goal
  795. of improving usability, security and speed.")
  796. (license license:asl2.0)))
  797. (define-public python-blurhash
  798. (package
  799. (name "python-blurhash")
  800. (version "1.1.4")
  801. (source
  802. (origin
  803. ;; Tests not included in pypi release and releases not tagged in git repo.
  804. (method git-fetch)
  805. (uri (git-reference
  806. (url "https://github.com/halcy/blurhash-python")
  807. (commit "22e081ef1c24da1bb5c5eaa2c1d6649724deaef8")))
  808. (file-name (git-file-name name version))
  809. (sha256
  810. (base32
  811. "1qq6mhydlp7q3na4kmaq3871h43wh3pyfyxr4b79bia73wjdylxf"))))
  812. (build-system python-build-system)
  813. (arguments
  814. '(#:phases
  815. (modify-phases %standard-phases
  816. (replace 'check
  817. (lambda _
  818. (delete-file "setup.cfg")
  819. (invoke "pytest"))))))
  820. (native-inputs
  821. `(("python-numpy" ,python-numpy)
  822. ("python-pillow" ,python-pillow)
  823. ("python-pytest" ,python-pytest)))
  824. (home-page "https://github.com/halcy/blurhash-python")
  825. (synopsis
  826. "Pure-Python implementation of the blurhash algorithm")
  827. (description
  828. "Pure-Python implementation of the blurhash algorithm.")
  829. (license license:expat)))
  830. (define-public python-ecpy
  831. (package
  832. (name "python-ecpy")
  833. (version "0.10.0")
  834. (source
  835. (origin
  836. (method url-fetch)
  837. (uri (pypi-uri "ECPy" version))
  838. (sha256
  839. (base32
  840. "1gc3i5s93zq6x1nkaxkq1dvmsc12vmrw0hns9f5s1hcb78ni52c8"))))
  841. (build-system python-build-system)
  842. (propagated-inputs
  843. `(("python-future" ,python-future)))
  844. (home-page "https://github.com/ubinity/ECPy")
  845. (synopsis "Pure Python Elliptic Curve Library")
  846. (description "This package provides a Elliptic Curve Library in pure
  847. Python.")
  848. (license license:asl2.0)))
  849. (define-public python2-ecpy
  850. (package-with-python2 python-ecpy))
  851. (define-public python-josepy
  852. (package
  853. (name "python-josepy")
  854. (version "1.1.0")
  855. (source (origin
  856. (method url-fetch)
  857. (uri (pypi-uri "josepy" version))
  858. (sha256
  859. (base32
  860. "11khz8malzrv375b27jjkv66z6z6khdx1v5mkkr4vq16gp3n4p7v"))))
  861. (build-system python-build-system)
  862. (arguments
  863. ;; The tests require flake8 >= 3.5, which is not yet packaged.
  864. '(#:tests? #f))
  865. (propagated-inputs
  866. `(("python-cryptography" ,python-cryptography)
  867. ("python-pyopenssl" ,python-pyopenssl)
  868. ("python-six" ,python-six)))
  869. ;; TODO Enable when we have flake8 >= 3.5.
  870. ; (native-inputs
  871. ; `(("python-coverage" ,python-coverage)
  872. ; ("python-flake8" ,python-flake8)
  873. ; ("python-isort" ,python-isort)
  874. ; ("python-mock" ,python-mock)
  875. ; ("python-pytest" ,python-pytest)
  876. ; ("python-pytest-cov" ,python-pytest-cov)
  877. ; ("python-pytest-cache" ,python-pytest-cache)
  878. ; ("python-pytest-flake8" ,python-pytest-flake8)))
  879. (home-page "https://github.com/certbot/josepy")
  880. (synopsis "JOSE protocol implementation in Python")
  881. (description "This package provides a Python implementation of the JOSE
  882. protocol (Javascript Object Signing and Encryption).")
  883. (license license:asl2.0)))
  884. (define-public python2-josepy
  885. (package-with-python2 python-josepy))
  886. (define pycryptodome-unbundle-tomcrypt-snippet
  887. #~(begin
  888. ;; Unbundle libtomcrypt.
  889. (delete-file-recursively "src/libtom")
  890. (substitute* "src/DES.c"
  891. (("#include \"libtom/tomcrypt_des.c\"")
  892. "#include <tomcrypt.h>"))
  893. (substitute* "setup.py"
  894. (("include_dirs=\\['src/', 'src/libtom/'\\]")
  895. ;; FIXME: why does '-ltomcrypt' need to be added
  896. ;; manually, even when 'tomcrypt' is added to 'libraries'?
  897. ;; This behaviour is not documented at
  898. ;; <https://docs.python.org/3/extending/building.html>.
  899. "include_dirs=['src/'], libraries=['tomcrypt', 'tommath'],
  900. extra_link_args=['-ltomcrypt', '-ltommath']"))))
  901. (define-public python-pycryptodome
  902. (package
  903. (name "python-pycryptodome")
  904. (version "3.9.9")
  905. (source
  906. (origin
  907. (method url-fetch)
  908. (uri (pypi-uri "pycryptodome" version))
  909. (sha256
  910. (base32
  911. "1i4m74f88qj9ci8rpyzrbk2slmsdj5ipmwdkq6qk24byalm203li"))
  912. (modules '((guix build utils)))
  913. (snippet pycryptodome-unbundle-tomcrypt-snippet)))
  914. (build-system python-build-system)
  915. (inputs
  916. `(("libtomcrypt" ,libtomcrypt)
  917. ("libtommath" ,libtommath)))
  918. (home-page "https://www.pycryptodome.org")
  919. (synopsis "Low-level cryptographic Python library")
  920. (description
  921. "PyCryptodome is a self-contained Python package of low-level
  922. cryptographic primitives. It's not a wrapper to a separate C library like
  923. OpenSSL. To the largest possible extent, algorithms are implemented in pure
  924. Python. Only the pieces that are extremely critical to performance (e.g.,
  925. block ciphers) are implemented as C extensions.
  926. You are expected to have a solid understanding of cryptography and security
  927. engineering to successfully use these primitives. You must also be able to
  928. recognize that some are obsolete (e.g., TDES) or even insecure (RC4).
  929. It provides many enhancements over the last release of PyCrypto (2.6.1):
  930. @itemize
  931. @item Authenticated encryption modes (GCM, CCM, EAX, SIV, OCB)
  932. @item Accelerated AES on Intel platforms via AES-NI
  933. @item First-class support for PyPy
  934. @item Elliptic curves cryptography (NIST P-256 curve only)
  935. @item Better and more compact API (nonce and iv attributes for ciphers,
  936. automatic generation of random nonces and IVs, simplified CTR cipher mode, and
  937. more)
  938. @item SHA-3 (including SHAKE XOFs) and BLAKE2 hash algorithms
  939. @item Salsa20 and ChaCha20 stream ciphers
  940. @item scrypt and HKDF
  941. @item Deterministic (EC)DSA
  942. @item Password-protected PKCS#8 key containers
  943. @item Shamir’s Secret Sharing scheme
  944. @item Random numbers get sourced directly from the OS (and not from a CSPRNG
  945. in userspace)
  946. @item Cleaner RSA and DSA key generation (largely based on FIPS 186-4)
  947. @item Major clean-ups and simplification of the code base
  948. @end itemize
  949. This package provides drop-in compatibility with PyCrypto. It is one of two
  950. PyCryptodome variants, the other being python-pycryptodomex.")
  951. (license (list license:bsd-2
  952. license:public-domain)))) ; code inherited from PyCrypto
  953. (define-public python2-pycryptodome
  954. (package-with-python2 python-pycryptodome))
  955. (define-public python-pycryptodomex
  956. (package (inherit python-pycryptodome)
  957. (name "python-pycryptodomex")
  958. (version (package-version python-pycryptodome))
  959. (source
  960. (origin
  961. (method url-fetch)
  962. (uri (pypi-uri "pycryptodomex" version))
  963. (sha256
  964. (base32 "0lbx4qk3xmwqiidhmkj8qa7bh2lf8bwzg0xjpsh2w5zqjrc7qnvv"))
  965. (modules '((guix build utils)))
  966. (snippet pycryptodome-unbundle-tomcrypt-snippet)))
  967. (description
  968. "PyCryptodome is a self-contained Python package of low-level
  969. cryptographic primitives. It's not a wrapper to a separate C library like
  970. OpenSSL. To the largest possible extent, algorithms are implemented in pure
  971. Python. Only the pieces that are extremely critical to performance (e.g.,
  972. block ciphers) are implemented as C extensions.
  973. You are expected to have a solid understanding of cryptography and security
  974. engineering to successfully use these primitives. You must also be able to
  975. recognize that some are obsolete (e.g., TDES) or even insecure (RC4).
  976. It provides many enhancements over the last release of PyCrypto (2.6.1):
  977. @itemize
  978. @item Authenticated encryption modes (GCM, CCM, EAX, SIV, OCB)
  979. @item Accelerated AES on Intel platforms via AES-NI
  980. @item First-class support for PyPy
  981. @item Elliptic curves cryptography (NIST P-256 curve only)
  982. @item Better and more compact API (nonce and iv attributes for ciphers,
  983. automatic generation of random nonces and IVs, simplified CTR cipher mode, and
  984. more)
  985. @item SHA-3 (including SHAKE XOFs) and BLAKE2 hash algorithms
  986. @item Salsa20 and ChaCha20 stream ciphers
  987. @item scrypt and HKDF
  988. @item Deterministic (EC)DSA
  989. @item Password-protected PKCS#8 key containers
  990. @item Shamir’s Secret Sharing scheme
  991. @item Random numbers get sourced directly from the OS (and not from a CSPRNG
  992. in userspace)
  993. @item Cleaner RSA and DSA key generation (largely based on FIPS 186-4)
  994. @item Major clean-ups and simplification of the code base
  995. @end itemize
  996. PyCryptodomex is the stand-alone version of PyCryptodome that no longer
  997. provides drop-in compatibility with PyCrypto.")))
  998. (define-public python-m2crypto
  999. (package
  1000. (name "python-m2crypto")
  1001. (version "0.35.2")
  1002. (source
  1003. (origin
  1004. (method url-fetch)
  1005. (uri (pypi-uri "M2Crypto" version))
  1006. (sha256
  1007. (base32 "09yirf3w77w6f49q6nxhrjm9c3a4y9s30s1k09chqrw8zdgx8sjc"))))
  1008. (build-system python-build-system)
  1009. (arguments
  1010. `(;; FIXME: Tests start failing with time due to date checks in TLS
  1011. ;; certificates.
  1012. #:tests? #f))
  1013. (inputs `(("openssl" ,openssl)))
  1014. (native-inputs `(("swig" ,swig)))
  1015. (home-page "https://gitlab.com/m2crypto/m2crypto")
  1016. (synopsis "Python crypto and TLS toolkit")
  1017. (description "@code{M2Crypto} is a complete Python wrapper for OpenSSL
  1018. featuring RSA, DSA, DH, EC, HMACs, message digests, symmetric ciphers
  1019. (including AES); TLS functionality to implement clients and servers; HTTPS
  1020. extensions to Python's httplib, urllib, and xmlrpclib; unforgeable HMAC'ing
  1021. AuthCookies for web session management; FTP/TLS client and server; S/MIME;
  1022. M2Crypto can also be used to provide TLS for Twisted. Smartcards supported
  1023. through the Engine interface.")
  1024. (properties `((python2-variant . ,(delay python2-m2crypto))))
  1025. (license license:expat)))
  1026. (define-public python2-m2crypto
  1027. (let ((m2crypto (package-with-python2
  1028. (strip-python2-variant python-m2crypto))))
  1029. (package/inherit m2crypto
  1030. (propagated-inputs
  1031. `(("python2-typing" ,python2-typing))))))
  1032. (define-public python-pykeepass
  1033. (package
  1034. (name "python-pykeepass")
  1035. (version "3.2.1")
  1036. (source
  1037. (origin
  1038. (method git-fetch)
  1039. ;; Source tarball on PyPI doesn't include tests.
  1040. (uri (git-reference
  1041. (url "https://github.com/libkeepass/pykeepass")
  1042. (commit version)))
  1043. (file-name (git-file-name name version))
  1044. (sha256
  1045. (base32 "1symxf4ahylynihnp9z4z3lh2vy65ipvg8s4hjrnn936hcaaxghk"))))
  1046. (build-system python-build-system)
  1047. (arguments
  1048. `(#:phases
  1049. (modify-phases %standard-phases
  1050. (add-after 'unpack 'make-kdbx-writable
  1051. ;; Tests have to write to the .kdbx files in the test directory.
  1052. (lambda _
  1053. (with-directory-excursion "tests"
  1054. (for-each make-file-writable (find-files "."))
  1055. #t)))
  1056. (add-before 'build 'patch-requirements
  1057. (lambda _
  1058. ;; Update requirements from dependency==version
  1059. ;; to dependency>=version.
  1060. (substitute* "setup.py"
  1061. (("==") ">="))
  1062. #t)))))
  1063. (propagated-inputs
  1064. `(("python-argon2-cffi" ,python-argon2-cffi)
  1065. ("python-construct" ,python-construct)
  1066. ("python-dateutil" ,python-dateutil)
  1067. ("python-future" ,python-future)
  1068. ("python-lxml" ,python-lxml)
  1069. ("python-pycryptodomex" ,python-pycryptodomex)))
  1070. (home-page "https://github.com/libkeepass/pykeepass")
  1071. (synopsis "Python library to interact with keepass databases")
  1072. (description
  1073. "This library allows you to write entries to a KeePass database. It
  1074. supports KDBX3 and KDBX4.")
  1075. ;; There are no copyright headers in the source code. The LICENSE file
  1076. ;; indicates GPL3.
  1077. (license license:gpl3+)))
  1078. (define-public python-pylibscrypt
  1079. (package
  1080. (name "python-pylibscrypt")
  1081. (version "1.7.1")
  1082. (source
  1083. (origin
  1084. (method url-fetch)
  1085. (uri (pypi-uri "pylibscrypt" version))
  1086. (sha256
  1087. (base32
  1088. "1b3rgzl6dbzs08vhv41b6y4n5189wv7lr27acxn104hs45745abs"))))
  1089. (build-system python-build-system)
  1090. (arguments
  1091. `(#:phases
  1092. (modify-phases %standard-phases
  1093. (add-before 'build 'hard-code-path-to-libscrypt
  1094. (lambda* (#:key inputs #:allow-other-keys)
  1095. (let ((libscrypt (assoc-ref inputs "libscrypt")))
  1096. (substitute* "pylibscrypt/pylibscrypt.py"
  1097. (("find_library\\('scrypt'\\)")
  1098. (string-append "'" libscrypt "/lib/libscrypt.so'")))
  1099. #t))))
  1100. ;; The library can use various scrypt implementations and tests all of
  1101. ;; them. Since we only provide a single implementation, most tests
  1102. ;; fail. Simply skip them.
  1103. #:tests? #f))
  1104. ;; FIXME: Using "libscrypt" is the second best choice. The best one
  1105. ;; requires "hashlib.scrypt", provided by Python 3.6+ built with OpenSSL
  1106. ;; 1.1+. Use that as soon as Guix provides it.
  1107. (inputs
  1108. `(("libscrypt" ,libscrypt)))
  1109. (home-page "https://github.com/jvarho/pylibscrypt")
  1110. (synopsis "Scrypt for Python")
  1111. (description "There are a lot of different scrypt modules for Python, but
  1112. none of them have everything that I'd like, so here's one more. It uses
  1113. @code{libscrypt}.")
  1114. (license license:isc)))
  1115. (define-public python-libnacl
  1116. (package
  1117. (name "python-libnacl")
  1118. (version "1.7.2")
  1119. (source
  1120. (origin
  1121. (method url-fetch)
  1122. (uri (pypi-uri "libnacl" version))
  1123. (sha256
  1124. (base32
  1125. "0srx7i264v4dq9and8y6gpzzhrg8jpxs5iy9ggw4plimfj0rjfdm"))))
  1126. (build-system python-build-system)
  1127. (arguments
  1128. `(#:phases
  1129. (modify-phases %standard-phases
  1130. (add-after 'unpack 'locate-libsodium
  1131. (lambda* (#:key inputs #:allow-other-keys)
  1132. (substitute* "libnacl/__init__.py"
  1133. (("/usr/local/lib/libsodium.so")
  1134. (search-input-file inputs "/lib/libsodium.so"))))))))
  1135. (native-inputs
  1136. `(("python-pyhamcrest" ,python-pyhamcrest)))
  1137. (inputs
  1138. `(("libsodium" ,libsodium)))
  1139. (home-page "https://libnacl.readthedocs.org/")
  1140. (synopsis "Python bindings for libsodium based on ctypes")
  1141. (description "@code{libnacl} is used to gain direct access to the
  1142. functions exposed by @code{NaCl} library via @code{libsodium}. It has
  1143. been constructed to maintain extensive documentation on how to use
  1144. @code{NaCl} as well as being completely portable.")
  1145. (license license:asl2.0)))
  1146. (define-public python-pyotp
  1147. (package
  1148. (name "python-pyotp")
  1149. (version "2.4.1")
  1150. (source
  1151. (origin
  1152. (method url-fetch)
  1153. (uri (pypi-uri "pyotp" version))
  1154. (sha256
  1155. (base32 "0jsqfmx9i7j8z81r4zazv76xzy1fcq8v9s2r4kvx7ajfndq3z2h3"))))
  1156. (build-system python-build-system)
  1157. (home-page "https://github.com/pyauth/pyotp")
  1158. (synopsis "Python One Time Password Library")
  1159. (description
  1160. "PyOTP is a Python library for generating and verifying one-time
  1161. passwords. It can be used to implement two-factor (2FA) or multi-factor
  1162. (MFA) authentication methods in web applications and in other systems that
  1163. require users to log in.")
  1164. (license license:expat)))
  1165. (define-public python-scrypt
  1166. (package
  1167. (name "python-scrypt")
  1168. (version "0.8.7")
  1169. (source
  1170. (origin
  1171. (method url-fetch)
  1172. (uri (pypi-uri "scrypt" version))
  1173. (sha256
  1174. (base32
  1175. "0hjk71k3mgnl8siikm9lii9im8kv0rb7inkjzx78rnancra48xxr"))))
  1176. (build-system python-build-system)
  1177. (inputs
  1178. `(("openssl" ,openssl)))
  1179. (home-page "https://bitbucket.org/mhallin/py-scrypt")
  1180. (synopsis "Bindings for the scrypt key derivation function library")
  1181. (description "This is a set of Python bindings for the scrypt key
  1182. derivation function.")
  1183. (license license:bsd-2)))
  1184. (define-public python-service-identity
  1185. (package
  1186. (name "python-service-identity")
  1187. (version "18.1.0")
  1188. (source
  1189. (origin
  1190. (method url-fetch)
  1191. (uri (pypi-uri "service_identity" version))
  1192. (sha256
  1193. (base32
  1194. "0b9f5qiqjy8ralzgwjgkhx82h6h8sa7532psmb8mkd65md5aan08"))))
  1195. (build-system python-build-system)
  1196. (propagated-inputs
  1197. `(("python-attrs" ,python-attrs)
  1198. ("python-pyasn1" ,python-pyasn1)
  1199. ("python-pyasn1-modules" ,python-pyasn1-modules)
  1200. ("python-pyopenssl" ,python-pyopenssl)))
  1201. (home-page "https://service-identity.readthedocs.io/")
  1202. (synopsis "Service identity verification for PyOpenSSL")
  1203. (description
  1204. "@code{service_identity} aspires to give you all the tools you need
  1205. for verifying whether a certificate is valid for the intended purposes.
  1206. In the simplest case, this means host name verification. However,
  1207. service_identity implements RFC 6125 fully and plans to add other
  1208. relevant RFCs too.")
  1209. (license license:expat)))
  1210. (define-public python2-service-identity
  1211. (package-with-python2 python-service-identity))
  1212. (define-public python-hkdf
  1213. (package
  1214. (name "python-hkdf")
  1215. (version "0.0.3")
  1216. (source
  1217. (origin
  1218. (method url-fetch)
  1219. (uri (pypi-uri "hkdf" version))
  1220. (sha256
  1221. (base32
  1222. "1jhxk5vhxmxxjp3zj526ry521v9inzzl8jqaaf0ma65w6k332ak2"))))
  1223. (build-system python-build-system)
  1224. (native-inputs
  1225. `(("python-nose" ,python-nose)))
  1226. (home-page "https://github.com/casebeer/python-hkdf")
  1227. (synopsis "HMAC-based Extract-and-Expand Key Derivation Function (HKDF)")
  1228. (description "This package provides a Python implementation of the HMAC Key
  1229. Derivation function (HKDF) defined in RFC 5869.")
  1230. (license license:bsd-2)))
  1231. (define-public python-spake2
  1232. (package
  1233. (name "python-spake2")
  1234. (version "0.8")
  1235. (source
  1236. (origin
  1237. (method url-fetch)
  1238. (uri (pypi-uri "spake2" version))
  1239. (sha256
  1240. (base32
  1241. "1x16r7lrbklvfzbacb66qv9iiih6liq1y612dqh2chgf555n2yn1"))))
  1242. (build-system python-build-system)
  1243. (propagated-inputs
  1244. `(("python-hkdf" ,python-hkdf)))
  1245. (home-page "https://github.com/warner/python-spake2")
  1246. (synopsis "SPAKE2 password-authenticated key exchange in Python")
  1247. (description "This package provides a Python implementation of the SPAKE2
  1248. Password-Authenticated Key Exchange algorithm.")
  1249. (license license:expat)))
  1250. (define-public python-txtorcon
  1251. (package
  1252. (name "python-txtorcon")
  1253. (version "19.0.0")
  1254. (source
  1255. (origin
  1256. (method url-fetch)
  1257. (uri (pypi-uri "txtorcon" version))
  1258. (sha256
  1259. (base32
  1260. "0fxzhsc62bhmr730vj9pzallmw56gz6iykvl28a5agrycm0bfc9p"))))
  1261. (build-system python-build-system)
  1262. (arguments
  1263. ;; The tests fail immediately due to a missing file. Reported upstream:
  1264. ;; <https://github.com/meejah/txtorcon/issues/330>
  1265. `(#:tests? #f))
  1266. (propagated-inputs
  1267. `(("python-automat" ,python-automat)
  1268. ("python-idna" ,python-idna)
  1269. ("python-incremental" ,python-incremental)
  1270. ("python-service-identity" ,python-service-identity)
  1271. ("python-twisted" ,python-twisted)
  1272. ("python-zope-interface" ,python-zope-interface)))
  1273. (home-page "https://github.com/meejah/txtorcon")
  1274. (synopsis "Twisted-based Tor controller client")
  1275. (description "This package provides a Twisted-based Tor controller client,
  1276. with state-tracking and configuration abstractions.")
  1277. (license license:expat)))
  1278. (define-public python-keyutils
  1279. (package
  1280. (name "python-keyutils")
  1281. (version "0.6")
  1282. (source
  1283. (origin
  1284. (method url-fetch)
  1285. (uri (pypi-uri "keyutils" version))
  1286. (sha256
  1287. (base32
  1288. "0lipygpzhwzzsq2k5imb1jgkmj8y4khxdwhzadjs3bd56g6bmkx9"))))
  1289. (build-system python-build-system)
  1290. (native-inputs
  1291. `(("python-pytest" ,python-pytest)
  1292. ("python-pytest-runner" ,python-pytest-runner)))
  1293. (inputs
  1294. `(("keyutils" ,keyutils)))
  1295. (arguments
  1296. '(#:tests? #f))
  1297. (home-page "https://github.com/sassoftware/python-keyutils")
  1298. (synopsis "Python bindings for keyutils")
  1299. (description
  1300. "This is a set of python bindings for keyutils, a key management suite
  1301. that leverages the infrastructure provided by the Linux kernel for safely
  1302. storing and retrieving sensitive information in your programs.")
  1303. (license license:asl2.0)))
  1304. (define-public python-mcuboot-imgtool
  1305. (package
  1306. (name "python-mcuboot-imgtool")
  1307. (version "1.4.0")
  1308. (source
  1309. (origin
  1310. (method git-fetch)
  1311. (uri (git-reference
  1312. (url "https://github.com/JuulLabs-OSS/mcuboot")
  1313. (commit (string-append "v" version))))
  1314. (file-name (git-file-name name version))
  1315. (sha256
  1316. (base32
  1317. "1m1csyvzq4jx81zg635ssy1n7sc0z539z0myh872ll3nwqx7wa0q"))))
  1318. (build-system python-build-system)
  1319. (arguments
  1320. `(#:phases
  1321. (modify-phases %standard-phases
  1322. (add-after 'unpack 'fix-broken-test
  1323. (lambda _
  1324. (substitute* "scripts/imgtool/keys/ed25519_test.py"
  1325. (("raw_sign") "sign_digest"))
  1326. #t))
  1327. (add-before 'build 'change-directory
  1328. (lambda _
  1329. (chdir "scripts")
  1330. #t)))))
  1331. (propagated-inputs
  1332. `(("python-click" ,python-click)
  1333. ("python-intelhex" ,python-intelhex)
  1334. ("python-cryptography" ,python-cryptography)))
  1335. (home-page "https://mcuboot.com")
  1336. (synopsis "Tool to securely sign firmware images for booting by MCUboot")
  1337. (description "MCUboot is a secure bootloader for 32-bit MCUs. This
  1338. package provides a tool to securely sign firmware images for booting by
  1339. MCUboot.")
  1340. (license license:expat)))
  1341. (define-public python-ntlm-auth
  1342. (package
  1343. (name "python-ntlm-auth")
  1344. (version "1.4.0")
  1345. (source
  1346. (origin
  1347. (method url-fetch)
  1348. (uri (pypi-uri "ntlm-auth" version))
  1349. (sha256
  1350. (base32
  1351. "16mavidki4ma5ip8srqalr19gz4f5yn3cnmmgps1fmgfr24j63rm"))))
  1352. (build-system python-build-system)
  1353. (propagated-inputs
  1354. `(("python-cryptography" ,python-cryptography)))
  1355. (home-page "https://github.com/jborean93/ntlm-auth")
  1356. (synopsis
  1357. "Calculates NTLM Authentication codes")
  1358. (description
  1359. "This library handles the low-level details of NTLM authentication for
  1360. use in authenticating with a service that uses NTLM. It will create and parse
  1361. the 3 different message types in the order required and produce a base64
  1362. encoded value that can be attached to the HTTP header.
  1363. The goal of this library is to offer full NTLM support including signing and
  1364. sealing of messages as well as supporting MIC for message integrity and the
  1365. ability to customise and set limits on the messages sent. Please see Features
  1366. and Backlog for a list of what is and is not currently supported.")
  1367. (license license:expat)))
  1368. (define-public python-secretstorage
  1369. (package
  1370. (name "python-secretstorage")
  1371. (version "3.3.1")
  1372. (source
  1373. (origin
  1374. (method url-fetch)
  1375. (uri (pypi-uri "SecretStorage" version))
  1376. (sha256
  1377. (base32
  1378. "15ginv4gzxrx77n7517xnvf2jcpqc6ran12s951hc85zlr8nqrpx"))))
  1379. (build-system python-build-system)
  1380. (arguments
  1381. '(#:tests? #f)) ; Tests require a running dbus service.
  1382. (propagated-inputs
  1383. `(("python-cryptography" ,python-cryptography)
  1384. ("python-jeepney" ,python-jeepney)))
  1385. (home-page "https://github.com/mitya57/secretstorage")
  1386. (synopsis "Python bindings to FreeDesktop.org Secret Service API")
  1387. (description
  1388. "@code{python-secretstorage} provides a way for securely storing passwords
  1389. and other secrets. It uses D-Bus Secret Service API that is supported by GNOME
  1390. Keyring (since version 2.30) and KSecretsService. SecretStorage supports most
  1391. of the functions provided by Secret Service, including creating and deleting
  1392. items and collections, editing items, locking and unlocking collections
  1393. (asynchronous unlocking is also supported).")
  1394. (license license:bsd-3)))
  1395. (define-public python-trustme
  1396. (package
  1397. (name "python-trustme")
  1398. (version "0.6.0")
  1399. (source
  1400. (origin
  1401. (method url-fetch)
  1402. (uri (pypi-uri "trustme" version))
  1403. (sha256
  1404. (base32 "0v3vr5z6apnfmklf07m45kv5kaqvm6hxrkaqywch57bjd2siiywx"))))
  1405. (build-system python-build-system)
  1406. (arguments
  1407. `(#:phases
  1408. (modify-phases %standard-phases
  1409. (replace 'check
  1410. (lambda* (#:key inputs outputs #:allow-other-keys)
  1411. (add-installed-pythonpath inputs outputs)
  1412. (invoke "pytest" "-vv"))))))
  1413. (native-inputs
  1414. `(("python-more-itertools" ,python-more-itertools)
  1415. ("python-pyopenssl" ,python-pyopenssl)
  1416. ("python-pytest" ,python-pytest)
  1417. ("python-pytest-cov" ,python-pytest-cov)
  1418. ("python-service-identity" ,python-service-identity)
  1419. ("python-zipp" ,python-zipp)))
  1420. (propagated-inputs
  1421. `(("python-cryptography" ,python-cryptography)))
  1422. (home-page "https://github.com/python-trio/trustme")
  1423. (synopsis "Fake a certificate authority for tests")
  1424. (description
  1425. "@code{trustme} is a tiny Python package that does one thing: it gives you
  1426. a fake certificate authority (CA) that you can use to generate fake TLS certs to
  1427. use in your tests.")
  1428. ;; Either license applies.
  1429. (license (list license:expat license:asl2.0))))
  1430. (define-public python-certipy
  1431. (package
  1432. (name "python-certipy")
  1433. (version "0.1.3")
  1434. (source
  1435. (origin
  1436. (method url-fetch)
  1437. (uri (pypi-uri "certipy" version))
  1438. (sha256
  1439. (base32
  1440. "0n980gqpzh0fm58h3i4mi2i10wgj606lscm1r5sk60vbf6vh8mv9"))))
  1441. (build-system python-build-system)
  1442. (propagated-inputs
  1443. `(("python-pyopenssl" ,python-pyopenssl)))
  1444. (native-inputs
  1445. `(("python-pytest" ,python-pytest)))
  1446. (home-page "https://github.com/LLNL/certipy")
  1447. (synopsis "Utility to create and sign CAs and certificates")
  1448. (description
  1449. "Certipy was made to simplify the certificate creation process. To that
  1450. end, certipy exposes methods for creating and managing certificate authorities,
  1451. certificates, signing and building trust bundles.")
  1452. (license license:bsd-3)))
  1453. (define-public python-jeepney
  1454. (package
  1455. (name "python-jeepney")
  1456. (version "0.6.0")
  1457. (source
  1458. (origin
  1459. (method url-fetch)
  1460. (uri (pypi-uri "jeepney" version))
  1461. (sha256
  1462. (base32 "0mw6ch5s4czpmsiwqwhcidgk27858pl8vlvb7acrxjkm4ribcnbx"))))
  1463. (build-system python-build-system)
  1464. (native-inputs
  1465. `(("python-testpath" ,python-testpath)
  1466. ("python-tornado" ,python-tornado)
  1467. ("python-trio" ,python-trio)
  1468. ("python-pytest" ,python-pytest)
  1469. ("python-pytest-trio" ,python-pytest-trio)))
  1470. (home-page "https://gitlab.com/takluyver/jeepney")
  1471. (synopsis "Low-level, pure Python DBus protocol wrapper")
  1472. (description
  1473. "This is a low-level, pure Python DBus protocol client. It has an
  1474. I/O-free core, and integration modules for different event loops.")
  1475. (license license:expat)))
  1476. (define-public python-argon2-cffi
  1477. (package
  1478. (name "python-argon2-cffi")
  1479. (version "20.1.0")
  1480. (source
  1481. (origin
  1482. (method url-fetch)
  1483. (uri (pypi-uri "argon2-cffi" version))
  1484. (sha256
  1485. (base32
  1486. "0zgr4mnnm0p4i99023safb0qb8cgvl202nly1rvylk2b7qnrn0nq"))
  1487. (modules '((guix build utils)))
  1488. (snippet '(begin (delete-file-recursively "extras") #t))))
  1489. (build-system python-build-system)
  1490. (arguments
  1491. '(#:phases
  1492. (modify-phases %standard-phases
  1493. (replace 'build
  1494. (lambda _
  1495. (setenv "ARGON2_CFFI_USE_SYSTEM" "1")
  1496. (invoke "python" "setup.py" "build")))
  1497. (replace 'check
  1498. (lambda* (#:key inputs outputs #:allow-other-keys)
  1499. (add-installed-pythonpath inputs outputs)
  1500. (invoke "pytest")
  1501. (invoke "python" "-m" "argon2" "--help")
  1502. ;; see tox.ini
  1503. (invoke "python" "-m" "argon2" "-n" "1" "-t" "1" "-m" "8" "-p" "1"))))))
  1504. (propagated-inputs
  1505. `(("python-cffi" ,python-cffi)
  1506. ("python-six" ,python-six)))
  1507. (inputs `(("argon2" ,argon2)))
  1508. (native-inputs
  1509. `(("python-hypothesis" ,python-hypothesis)
  1510. ("python-pytest" ,python-pytest)))
  1511. (home-page "https://argon2-cffi.readthedocs.io/")
  1512. (synopsis "Secure Password Hashes for Python")
  1513. (description
  1514. "Argon2 is a secure password hashing algorithm. It is designed to have
  1515. both a configurable runtime as well as memory consumption. This means that you
  1516. can decide how long it takes to hash a password and how much memory is required.")
  1517. (license license:expat)))
  1518. (define-public python-privy
  1519. (package
  1520. (name "python-privy")
  1521. (version "6.0.0")
  1522. (source
  1523. (origin
  1524. (method git-fetch)
  1525. (uri (git-reference
  1526. ;; Releases are untagged
  1527. (url "https://github.com/ofek/privy")
  1528. (commit "2838db3df239797c71bddacc48a4c49a83f35747")))
  1529. (file-name (git-file-name name version))
  1530. (sha256
  1531. (base32
  1532. "1m32dh5fqc8cy7jyf1z5fs6zvmdkbq5fi98hr609gbl7s0l0y0i9"))))
  1533. (build-system python-build-system)
  1534. (arguments
  1535. '(#:phases
  1536. (modify-phases %standard-phases
  1537. (replace 'check
  1538. (lambda _
  1539. (invoke "python" "-m" "pytest"))))))
  1540. (native-inputs
  1541. `(("python-pytest" ,python-pytest)))
  1542. (propagated-inputs
  1543. `(("python-argon2-cffi" ,python-argon2-cffi)
  1544. ("python-cryptography" ,python-cryptography)))
  1545. (home-page "https://www.dropbox.com/developers")
  1546. (synopsis "Library to password-protect your data")
  1547. (description
  1548. "Privy is a small and fast utility for password-protecting secret
  1549. data such as API keys, cryptocurrency wallets, or seeds for digital
  1550. signatures.")
  1551. (license (list license:expat license:asl2.0)))) ; dual licensed
  1552. (define-public python-pgpy
  1553. (package
  1554. (name "python-pgpy")
  1555. (version "0.5.3")
  1556. (source
  1557. (origin
  1558. (method url-fetch)
  1559. (uri (pypi-uri "PGPy" version))
  1560. (sha256
  1561. (base32 "11rrq15gmn6qbahli7czflfcngjl7zyybjlvk732my6axnf2d754"))))
  1562. (build-system python-build-system)
  1563. (arguments
  1564. `(#:phases
  1565. (modify-phases %standard-phases
  1566. (replace 'check
  1567. (lambda* (#:key tests? #:allow-other-keys)
  1568. (when tests?
  1569. (invoke "pytest")))))))
  1570. (native-inputs
  1571. `(("python-cryptography" ,python-cryptography)
  1572. ("python-pyasn1" ,python-pyasn1)
  1573. ("python-pytest" ,python-pytest)
  1574. ("python-singledispatch" ,python-singledispatch)
  1575. ("python-six" ,python-six)
  1576. ("python-wheel" ,python-wheel)))
  1577. (home-page "https://github.com/SecurityInnovation/PGPy")
  1578. (synopsis "Python implementation of OpenPGP")
  1579. (description
  1580. "Currently, PGPy can load keys and signatures of all kinds in both ASCII
  1581. armored and binary formats.
  1582. It can create and verify RSA, DSA, and ECDSA signatures, at the moment. It
  1583. can also encrypt and decrypt messages using RSA and ECDH.")
  1584. (license license:bsd-3)))
  1585. (define-public python-sop
  1586. (package
  1587. (name "python-sop")
  1588. (version "0.2.0")
  1589. (source
  1590. (origin
  1591. (method url-fetch)
  1592. (uri (pypi-uri "sop" version))
  1593. (sha256
  1594. (base32
  1595. "0gljyjsdn6hdmwlwwb5g5s0c031p6izamvfxp0d39x60af8k5jyf"))))
  1596. (build-system python-build-system)
  1597. (arguments
  1598. '(#:tests? #f)) ; There are no tests, and unittest throws an error trying
  1599. ; to find some:
  1600. ; TypeError: don't know how to make test from: 0.2.0
  1601. (home-page "https://gitlab.com/dkg/python-sop")
  1602. (synopsis "Stateless OpenPGP Command-Line Interface")
  1603. (description
  1604. "The Stateless OpenPGP Command-Line Interface (or sop) is a
  1605. specification that encourages OpenPGP implementors to provide a common,
  1606. relatively simple command-line API for purposes of object security.
  1607. This Python module helps implementers build such a CLI from any implementation
  1608. accessible to the Python interpreter.
  1609. It does not provide such an implementation itself -- this is just the
  1610. scaffolding for the command line, which should make it relatively easy to
  1611. supply a handful of python functions as methods to a class.")
  1612. (license license:expat))) ; MIT license