Exemple #1
0
    def getAccountStatus(self, user, req):
        password  = self.getAccountData(user)['password']
        salt      = hashlib.sha256(password).hexdigest()
        encrypted = PBKDF2(password, salt, iterations=1000).hexread(32)

        return json_loads(req.load("http://www2.smoozed.com/api/login",
                                   get={'auth': user, 'password': encrypted}))
Exemple #2
0
def generateCryptoKeys(parent_key, salt, iterations):
    # NB: We XOR parts of the keystream into the randomly-generated parts, just
    # in case os.urandom() isn't as random as it should be.  Note that if
    # os.urandom() returns truly random data, this will have no effect on the
    # overall security.
    keystream = PBKDF2(parent_key, salt, iterations=iterations)
    cipher_key = keystream.read(keyLength)
    return cipher_key
Exemple #3
0
    def get_account_status(self, user, password):
        password = password
        salt = hashlib.sha256(password).hexdigest()
        encrypted = PBKDF2(password, salt, iterations=1000).hexread(32)

        html = self.load("http://www2.smoozed.com/api/login",
                         get={
                             'auth': user,
                             'password': encrypted
                         })
        return json.loads(html)
    def loadAccountData(self, user, req):
        passwd = self.getAccountData(user)['password']
        salt   = passwd[::-1]
        pbkdf2 = PBKDF2(passwd, salt, 1000).hexread(16)

        result = json_loads(req.load("https://www.oboom.com/1/login", get={"auth": user, "pass": pbkdf2}))

        if not result[0] == 200:
            self.logWarning(_("Failed to log in: %s") % result[1])
            self.wrongPassword()

        return result[1]
Exemple #5
0
    def load_account_data(self, user, password):
        salt = password[::-1]
        pbkdf2 = PBKDF2(password, salt, 1000).hexread(16)

        html = self.load(
            "http://www.oboom.com/1/login",  # @TODO: Revert to `https` in 0.4.10
            get={
                'auth': user,
                'pass': pbkdf2
            })
        result = json.loads(html)

        if result[0] != 200:
            self.log_warning(_("Failed to log in: %s") % result[1])
            self.fail_login()

        return result[1]