에 의해 인코딩 다음의 암호를 해독하는 방법 그러나복어 암호 해독 내가 thefollowing 한, <a href="https://raw.github.com/usefulfor/usefulfor/master/security/JBoss.java" rel="nofollow">https://raw.github.com/usefulfor/usefulfor/master/security/JBoss.java</a>에서 발견 된 코드를 사용 javax.crypto의
bash-3.2$ java -cp . JBoss -e testpython
-27038292d345798947e2852756afcf0a
bash-3.2$ java -cp . JBoss -d -27038292d345798947e2852756afcf0a
testpython
을, 나는 내 인생에 대한 알아낼 수 없습니다 문자열 '27038292d345798947e2852756afcf0a'파이썬에서 pycrypto 사용. Java 코드가 Blowfish를 사용하고 있고 'jaas가 암호'의 열쇠 인 방식이라고 생각합니다. 그러나 나는 파이썬에서 이것을하는 법을 전혀 알지 못한다. 다음은 대부분 인쇄 할 수없는 쓰레기의 결과입니다.
import Crypto
from Crypto.Cipher import Blowfish
from base64 import b64encode, b64decode
bs = Blowfish.block_size
key = 'jaas is the way'
plaintext = b'27038292d345798947e2852756afcf0a'
iv = '\0' * 8
c1 = Blowfish.new(key, Blowfish.MODE_ECB)
c2 = Blowfish.new(key, Blowfish.MODE_CBC, iv)
c3 = Blowfish.new(key, Blowfish.MODE_CFB, iv)
c4 = Blowfish.new(key, Blowfish.MODE_OFB, iv)
msg1 = c1.decrypt(plaintext)
msg2 = c2.decrypt(plaintext)
msg3 = c3.decrypt(plaintext)
msg4 = c4.decrypt(plaintext)
print "msg1 = %s\n" % msg1
print "msg2 = %s\n" % msg2
print "msg3 = %s\n" % msg3
print "msg4 = %s\n" % msg4
무엇이 누락 되었습니까?
감사합니다.
더에 오신 것을 환영합니다 SO를하는 데 도움이! 답변 옆에있는 확인란을 사용하여 답변을 수락 된 것으로 표시하십시오. – jterrace