Skip to content

Instantly share code, notes, and snippets.

@stefan-wolfsheimer
Last active November 25, 2020 10:49
Show Gist options
  • Save stefan-wolfsheimer/054217e053bd72a828b1a155f31cd3b7 to your computer and use it in GitHub Desktop.
Save stefan-wolfsheimer/054217e053bd72a828b1a155f31cd3b7 to your computer and use it in GitHub Desktop.
irods password obfuscation with python
#!/usr/bin/env python3
# ######################################################
# irods password obfuscation on system without icommands
#
# Usage:
# 1. install irods python client with
# pip3 install python-irodsclient
# (see https://github.com/irods/python-irodsclient )
# 2. execute script
#
import irods.password_obfuscation as password_obfuscation
from getpass import getpass
import os
irods_a_file = os.path.expanduser('~/.irods/.irodsA')
with open(irods_a_file, "w") as fp:
password = getpass()
pw = password_obfuscation.encode(password)
fp.write(pw)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment