Security Password encryptionx

watermelonroachdaleInternet και Εφαρμογές Web

30 Ιουλ 2012 (πριν από 5 χρόνια και 1 μήνα)

330 εμφανίσεις

Secu
r
ity Password encryption /decryption

example for Jython


Tester2.py



Module to verify main functions in encryptUtil.py. Uses hard code values to test module
return values

encryptUtil.py



The primary functions used to encrypt/decrypt a password

generateKeys.py

<primary key file> <public key file>
-

module use to create a private and public key
file

encrypt.py

<public key file> < password>
-

module used to create an encrypted value for a “password”.
Results are printed and sent to a file calle
d key.txt/

decrypt.py

<private key file> <encrypted key file>
-

module that uses the private key and the encrypted
password stored in a file (key.txt) to decrypt the original password.


Example:

generateKeys.py private.pem public.pem

Creates 2 files with t
he private key being stored in private.pem and the public key being stored in
public.pem

encrypt.py public.pem secret

Creates a file key.txt with the encrypted password and also print the encrypted password to the screen

Example run:

C:
\
Documents and Sett
ings
\
dlhoward
\
AST
\
workspace
\
LDS>"C:
\
Program
Files
\
IBM
\
WebSphere
\
AppServer
\
profiles
\
Dmgr01
\
bin
\
wsadmin"
-
lang jython
-
f
encrypt.py public.pem
secret2

WASX7209I: Connected to process "dmgr" on node wm
-
dlhowardCellManager01 using SOAP connector;
The type of
process is: DeploymentManager

WASX7303I: The following options are passed to the scripting environment and are available as
arguments that are stored in the argv variable: "[public.pem, secret2]"

CymIk/sE1VdSPakkCjMWOs3s+ylpQGHp7ppkmoF2nQIKRWNLpk/V0speBFFA
GBvXTsUhIBLeOiA3

jHORREZoQzVMYFKI9epurc0dRUxMqcOfPBev9NaJ1TJbHnvdJHRHyGOSmcT1oLE3NmqAHgl7ef1k

tVBvSmDnxi8fh0lJyPk=


decrypt.py private.pem key.txt


Example run:


C:
\
Documents and Settings
\
dlhoward
\
AST
\
workspace
\
LDS>"C:
\
Program
Files
\
IBM
\
WebSphere
\
AppServer
\
profiles
\
Dmgr01
\
bin
\
wsadmin"
-
lang jython
-
f
decrypt.py
private.pem key.txt

WASX7209I: Connected to process "dmgr" on node wm
-
dlhowardCellManager01 using SOAP connector;
The type of process is: DeploymentManager

WASX7303I: The following options are passed to the scripting environment and are available as
arguments that are stored in the argv variable: "[private.pem, key.txt]"

Password:secret2