cottoncandy icon indicating copy to clipboard operation
cottoncandy copied to clipboard

Replace PyCrypto with PyCryptodome

Open kroq-gar78 opened this issue 1 year ago • 2 comments

Fixes #90 and allows installation for Python 3.11 and 3.12.

Not sure if any encryption-related functions are tested automatically.

kroq-gar78 avatar Sep 21 '24 07:09 kroq-gar78

Pinging @anwarnunez @candytaco : it looks like pycryptodome is a drop-in replacement of pycrypto with support of recent python versions.

mvdoc avatar Sep 23 '24 22:09 mvdoc

Thanks for the pull request @kroq-gar78 and thanks for pinging @mvdoc .

@kroq-gar78 : Apologies for my fuzzy memory but yes as far as I recall encryption functionality is tested automatically with a series of upload/downloads. However, I'm not sure there is an explicit test to decrypt a pre-existing object.

I'm curious as to the level of backwards compatibility here. Does it mean that existing arrays encrypted with pycrypto will be seemlessly decrypted with pycryptodome? We need to (1) perform this test and ideally (2) incorporate it as a unitest in order to proceed.

@kroq-gar78 Are you able to perform (1) on your end? @candytaco (2) would require storing a known array (e.g. np.arange()) in the test bucket that persists across CI runs, with the object name being tagged with pycrypto and python versions. The unitest can then glob those objects and download+decrypt them. Would you or someone in the lab be able to take that on? I no longer have credentials.

Another option is to remove support for encryption but I'm not sure how disruptive that would be. It's not great that pycrypto is preventing cottoncandy installs in Python 3.11+.

anwarnunez avatar Sep 24 '24 10:09 anwarnunez

Encryption was removed by https://github.com/gallantlab/cottoncandy/pull/94 , so this PR is obsolete.

kroq-gar78 avatar Mar 01 '25 00:03 kroq-gar78