Python
-
Python과 Java에서 사용가능한 AES 암/복호화 모듈Python 2018. 1. 24. 14:14
엔진단은 Python으로 되어 있고, WEB은 JAVA로 되어 있는 프로젝트에서 AES 256기반의 암/복호화 처리를 한다. 단순하게 KEY와 SALT만 마춰주면 된다.Python Sourcefrom Crypto.Cipher import AESimport base64import hashlib BS = AES.block_sizepad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)unpad = lambda s : s[0:-ord(s[-1])] if __name__ == '__main__': key = "12345678901234567890123456789012"; # 32bit iv = '1234567890123456' # 16bit beforeCi..
-
Python에서 virualenv 과 virtualenvwrapper 설치하기Python 2017. 12. 21. 16:46
virualenv 와 virtualenvwrappervirualenv여러개의 Python 프로젝트를 진행할때 의존성 문제를 해결 하기 위하여 가상환경을 구성하는 모듈 이다.virtualenvwrappervirualenv 를 감싸서 쉽게 관리 하기 위한 모듈이다.설치pip install virtualenv virtualenvwrapper virtualenvwrapper 설정~/.bash_profile 에 설정# Create a backup of your .bash_profile cp ~/.bash_profile ~/.bash_profile-org # Be careful with this command printf '\n%s\n%s\n%s' '# virtualenv' 'export WORKON_HOME=~/..