Skip to content

Commit cc6bcb6

Browse files
committed
Pin version of openssl and use it to encrypt and decrypt rosetta
1 parent c118c16 commit cc6bcb6

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

code/rosetta_minimal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def prep_for_squid(rosetta_minimal_dir, squid_dir, encryption_password):
3131

3232
# encrypt the tar file for extra security against public distribution
3333
tar_fn_encrypted = join(squid_dir_with_datetime, "rosetta_min_enc.tar.gz")
34-
encrypt_cmd = ["openssl", "enc", "-e", "-aes256",
34+
encrypt_cmd = ["conda", "run", "-n", "rosettafy", "openssl", "enc", "-e", "-aes256", "-pbkdf2",
3535
"-in", tar_fn, "-out", tar_fn_encrypted, "-pass", "pass:{}".format(encryption_password)]
3636
subprocess.call(encrypt_cmd)
3737

htcondor/templates/run.sh

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,6 @@ echo "Combining Rosetta split files"
2929
cat rosetta_min_enc.tar.gz.* > rosetta_min_enc.tar.gz
3030
rm rosetta_min_enc.tar.gz.*
3131

32-
# decrypt
33-
echo "Decrypting Rosetta"
34-
openssl version # echo the version for my knowledge
35-
# this was encrypted w/ openssl v > 1.1.0, which uses default digest sha256
36-
# include "-md sha256" for decrypt compatibility with older versions that used md5
37-
openssl enc -d -aes256 -md sha256 -in rosetta_min_enc.tar.gz -out rosetta_min.tar.gz -pass file:pass.txt
38-
39-
rm rosetta_min_enc.tar.gz
40-
41-
# extract
42-
echo "Extracting Rosetta"
43-
tar -xf rosetta_min.tar.gz
44-
rm rosetta_min.tar.gz
45-
4632
# set up the python environment (from packaged version)
4733
# https://chtc.cs.wisc.edu/conda-installation.shtml
4834

@@ -55,6 +41,19 @@ mkdir rosettafy_env
5541
tar -xzf rosettafy_env_v0.4.tar.gz -C rosettafy_env
5642
. rosettafy_env/bin/activate
5743

44+
# decrypt
45+
# note this is done AFTER setting up the Python environment because it requires
46+
# the openssl version inside the environment
47+
echo "Decrypting Rosetta"
48+
openssl version # echo the version for my knowledge
49+
openssl enc -d -aes256 -pbkdf2 -in rosetta_min_enc.tar.gz -out rosetta_min.tar.gz -pass file:pass.txt
50+
rm rosetta_min_enc.tar.gz
51+
52+
# extract
53+
echo "Extracting Rosetta"
54+
tar -xf rosetta_min.tar.gz
55+
rm rosetta_min.tar.gz
56+
5857
# launch our python run script with argument file number
5958
echo "Launching energize.py"
6059
python3 code/energize.py @energize_args.txt --variants_fn="${PROCESS}.txt" --cluster="$CLUSTER" --process="$PROCESS" --commit_id="$GITHUB_TAG"

setup/rosettafy_env.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ dependencies:
1111
- biopython=1.78
1212
- jupyterlab=3.0.12
1313
- sqlalchemy=1.4.39
14+
- openssl=3.1.1

0 commit comments

Comments
 (0)