import hashlib
Nonce = "15940832311731994988"
Salt = "2586456158"
Usr = "admin"
Psw = "10203040"
#SHA512(psw+salt)
con1 = Psw +Salt
Hash1 = hashlib.sha512(con1.encode('UTF-8'))
#sha512(Hash1+nonce)
con2 = Hash1.hexdigest()+Nonce
Hash2 = hashlib.sha512(con2.encode('UTF-8'))
#Result
Res = "LOGINPSW@"+Usr+":"+Hash2.hexdigest()
print(Res)
aW1wb3J0IGhhc2hsaWIKTm9uY2UgPSAiMTU5NDA4MzIzMTE3MzE5OTQ5ODgiClNhbHQgPSAiMjU4NjQ1NjE1OCIKVXNyID0gImFkbWluIgpQc3cgPSAiMTAyMDMwNDAiCiNTSEE1MTIocHN3K3NhbHQpCmNvbjEgPSBQc3cgK1NhbHQKSGFzaDEgPSBoYXNobGliLnNoYTUxMihjb24xLmVuY29kZSgnVVRGLTgnKSkKI3NoYTUxMihIYXNoMStub25jZSkKY29uMiA9IEhhc2gxLmhleGRpZ2VzdCgpK05vbmNlCkhhc2gyID0gaGFzaGxpYi5zaGE1MTIoY29uMi5lbmNvZGUoJ1VURi04JykpCgojUmVzdWx0ClJlcyA9ICJMT0dJTlBTV0AiK1VzcisiOiIrSGFzaDIuaGV4ZGlnZXN0KCkKcHJpbnQoUmVzKQ==
aW1wb3J0IGhhc2hsaWIKaGVhZGVyX2hleCA9ICgmcXVvdDswMTAwMDAwMCZxdW90OyArICZxdW90OzgxY2QwMmFiN2U1NjllOGJjZDkzMTdlMmZlOTlmMmRlNDRkNDlhYjJiODg1MWJhNGEzMDgwMDAwMDAwMDAwMDAmcXVvdDsgKyAmcXVvdDtlMzIwYjZjMmZmZmM4ZDc1MDQyM2RiOGIxZWI5NDJhZTcxMGU5NTFlZDc5N2Y3YWZmYzg4OTJiMGYxZmMxMjJiJnF1b3Q7ICsgJnF1b3Q7YzdmNWQ3NGQmcXVvdDsgKyAmcXVvdDtmMmI5NDQxYSZxdW90OyArICZxdW90OzQyYTE0Njk1JnF1b3Q7KQpoZWFkZXJfYmluID0gaGVhZGVyX2hleC5kZWNvZGUoJ2hleCcpCnRlc3QgPSBoYXNobGliLnNoYTI1NihoZWFkZXJfYmluKS5kaWdlc3QoKQpwcmludCAmcXVvdDtQZXJ2eWkgcHJva2hvZCZxdW90OwpwcmludCB0ZXN0
import hashlib
header_hex = ("01000000" + "81cd02ab7e569e8bcd9317e2fe99f2de44d49ab2b8851ba4a308000000000000" + "e320b6c2fffc8d750423db8b1eb942ae710e951ed797f7affc8892b0f1fc122b" + "c7f5d74d" + "f2b9441a" + "42a14695")
header_bin = header_hex.decode('hex')
test = hashlib.sha256(header_bin).digest()
print "Pervyi prokhod"
print test