MCPcopy Index your code
hub / github.com/bslatkin/effectivepython / run_encrypt

Function run_encrypt

example_code/item_067.py:110–121  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

108# $env:path = $env:path + ";C:\Program Files\OpenSSL-Win64\bin"
109
110def run_encrypt(data):
111 env = os.environ.copy()
112 env["password"] = "zf7ShyBhZOraQDdE/FiZpm/m/8f9X+M1"
113 proc = subprocess.Popen(
114 ["openssl", "enc", "-des3", "-pbkdf2", "-pass", "env:password"],
115 env=env,
116 stdin=subprocess.PIPE,
117 stdout=subprocess.PIPE,
118 )
119 proc.stdin.write(data)
120 proc.stdin.flush() # Ensure that the child gets input
121 return proc
122
123
124print("Example 6")

Callers 1

item_067.pyFile · 0.85

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected