Jump to content
View in the app

A better way to browse. Learn more.

HWBOT Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

There is an issue with the supplied data file. when uploading data file

Featured Replies

I'm updating my benchmark to use encrypted datafiles, and I get this error when I try to upload something.

Without encryption the datafiles seem to work just fine, but when I add it I get this error.

I am using AES 128 CBC.

this is the unencrypted .xml file

datafile.xml

and this is the encrypted one 

datafile.hwbot

when it goes public I will change the key, so here it is

3778214125442A472D4B615064536756

and the initialization vector 

6E5A723475377821

The iv has to be 16 bytes otherwise cryptodome, the library I use, launches an exception.

this is the function that creates the .xml and encrypts it

def datafile(second):
    time = datetime.datetime.now()
    submission = ET.Element('submission')
    application = ET.Element('application')
    name = ET.Element('name')
    version = ET.Element('version')
    score = ET.Element('score')
    points = ET.Element('points')
    timestamp = ET.Element('timestamp')

    name.text = 'PYPrime'
    version.text = '1.4.1'
    points.text = str(second)
    timestamp.text = str(time)
    submission.set('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance")
    submission.set('xmlns', "http://hwbot.org/submit/api?client=pyprime&clientVersion=1.4.1")

    submission.append(application)
    application.append(name)
    application.append(version)
    submission.append(score)
    score.append(points)
    submission.append(timestamp)

    file = open("datafile.hwbot", 'wb')
    file2 = open("datafile.xml", 'wb')

    key = b'3778214125442A472D4B615064536756'

    iv = b'6E5A723475377821'

    cipher = AES.new(key, AES.MODE_CBC, iv=iv)
    file.write(cipher.encrypt(pad(ET.tostring(submission, xml_declaration=True, encoding="utf-8"), 16)))
    file2.write(ET.tostring(submission, xml_declaration=True, encoding="utf-8"))
    file.close()

I've been on stuck on this thing for about 10 hours, I hope someone can help me.

  • Author

So after a good day of me basically wanting to die I figured out the problem, the hwbot api wants the key and initialization vector encoded in hex notation, while I have to use it in base64 inside python.

That's why the iv is 32byes long in hwbot while it has to be 16 bytes long in python!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.