Jump to content

last_account.cfg unprotected?


Recommended Posts

Hello everybody

 

I am wondering is there a way to encrypted the password in last_account.cfg because now its unprotected you see the password in the files.

 

Now you see this https://metin2.download/picture/O65xwV04oo7L1JXjm8iDDSge14GQG9Z4/.png

 

Is there a way to make it impossible to open but client can read it or make the password encrypted.

 

I hope somebody can help me with this!

 

Thanks in advance

 

-Aurora

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Active Member

PyCrypto is very nice libary(for encrpyt data);

https://pypi.python.org/pypi/pycrypto

Example:

from Crypto.Cipher import AES
import base64
import os

#@http://www.codekoala.com:4000/posts/aes-encryption-python-using-pycrypto/
BLOCK_SIZE = 32
PADDING = '{'

pad = lambda s: s + (BLOCK_SIZE - len(s) % BLOCK_SIZE) * PADDING

EncodeAES = lambda c, s: base64.b64encode(c.encrypt(pad(s)))
DecodeAES = lambda c, e: c.decrypt(base64.b64decode(e)).rstrip(PADDING)

secret = os.urandom(BLOCK_SIZE)
cipher = AES.new(secret)

encoded = EncodeAES(cipher, 'password')
print 'Encrypted string:', encoded

decoded = DecodeAES(cipher, encoded)
print 'Decrypted string:', decoded

and

 

_winreg is nice trick(for register data in registry);

https://docs.python.org/2/library/_winreg.html

Example:

import _winreg

REG_PATH = r"SOFTWAREMetin2Settings"
#@http://stackoverflow.com/questions/15128225/python-script-to-read-and-write-a-path-to-registry
def set_reg(name, value):
    try:
        _winreg.CreateKey(_winreg.HKEY_CURRENT_USER, REG_PATH)
        registry_key = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, REG_PATH, 0,
                                       _winreg.KEY_WRITE)
        _winreg.SetValueEx(registry_key, name, 0, _winreg.REG_SZ, value)
        _winreg.CloseKey(registry_key)
        return True
    except WindowsError:
        return False

def get_reg(name):
    try:
        registry_key = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, REG_PATH, 0,
                                       _winreg.KEY_READ)
        value, regtype = _winreg.QueryValueEx(registry_key, name)
        _winreg.CloseKey(registry_key)
        return value
    except WindowsError:
        return None

set_reg("ID", "koray")
set_reg("PASS", "123")

print "ID: " + get_reg("ID") + " Pass: " + get_reg("PASS")

##Output;
#>>ID: koray Pass: 123

 

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.