Last active
December 17, 2015 23:09
-
-
Save Ancillas/5687150 to your computer and use it in GitHub Desktop.
A small python script to encrypt strings for use in ColdFusion config files. Normally config files, such as neo-datasource.xml, are generated by the ColdFusion admin tool. It encrypts password strings, and puts the encrypted value in the config files. This script will allow you to pre-encrypt strings, which makes administrative control easier wh…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyDes | |
from pyDes import * | |
import base64 | |
import getpass | |
import sys | |
pwd = getpass.getpass('Enter password') | |
key = getpass.getpass('Enter key (optional)') | |
if not key: | |
key = '0yJ!@1$r8p0L@r1$6yJ!@1rj' | |
k = pyDes.triple_des(key) | |
d = k.decrypt(base64.decodestring(pwd), padmode=PAD_PKCS5) | |
print d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyDes | |
from pyDes import * | |
import base64 | |
import getpass | |
import sys | |
pwd = getpass.getpass('Enter password') | |
key = getpass.getpass('Enter key (optional)') | |
if not key: | |
key = '0yJ!@1$r8p0L@r1$6yJ!@1rj' | |
k = pyDes.triple_des(key) | |
e = k.encrypt(pwd, padmode=PAD_PKCS5) | |
print base64.encodestring(e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment