HISE Logo Forum
    • Categories
    • Register
    • Login

    Writing and Reading Obfuscated Folders?

    Scheduled Pinned Locked Moved Unsolved Scripting
    5 Posts 3 Posters 266 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • clevername27C
      clevername27
      last edited by clevername27

      Does anyone know how I'd go about — obfuscating a folder, for each sample map, containing the samples, as well as arbitrary data files I could read and write? The user wouldn't expand these files—HISE would read directly from them. (I'm assuming that by default, SampleMaps are not viewable by users.)

      I've seen the .hxi format, as well as the encryption API, in the docs. I'm not sure how to put it all together, though (and if it's even possible).

      Any help is greatly appreciated.

      d.healeyD A 2 Replies Last reply Reply Quote 0
      • d.healeyD
        d.healey @clevername27
        last edited by

        @clevername27 Why would you want to do that?

        I mean numbers are numbers, so you could just move the notes to a different value based on some kind of look up table.

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        clevername27C 1 Reply Last reply Reply Quote 1
        • clevername27C
          clevername27 @d.healey
          last edited by

          @d-healey Thank you, interesting idea. Will think on, and rephrase.

          1 Reply Last reply Reply Quote 0
          • A
            aaronventure @clevername27
            last edited by

            @clevername27 You can compress the samples to monoliths, which are encoded by default. You can then accompany these with a file (which is any extension, use something unknown so it doesn't suggest an app to open it with) which will contain a JSON object with your data. You can encode the the entire string with RSA and call FileSystem.decryptWithRSA().

            If it's not encrypted, use File.loadAsObject().

            Extension doesn't matter, HISE will attempt to read it the way you instruct it to.

            Alternatively, you can store JSON on your server, github even if you don't care about it being public (github has stupidly high rate limits per file so no worries about access issues), pull it from there. If you don't want to open the repo publicly and want to use it internally (like you mentioned a couple a times here on the forum), you can generate an access token and access the file directly, i think it's

            https://USERNAME:TOKEN@api.github.com/repos/USERNAME/REPO/contents/PATH_TO_FILE
            

            I say use it internally because this link would be embedded in the plugin and it's a rather bad idea to share your token, unless you make a specific account with just a single repo ( I don't know if you can make the access token on github read-only; didn't go into that yet). You can also have a serverless access: create a custom function on AWS Lambda or Cloud functions which have generous free tiers and very low pay-as-you-go once you bust 2 million calls per month or something like that.

            You'd just write a simple function in python, node, java, ruby, whatever, that fetches the JSON from your private repo on a POST call. The dashboard would get you the API endpoint for that specific function and you'd just call that with POST from your HISE plugin using the Server.API.

            The files in your Github repo would be raw JSON. Look at the example in the server.callWithPost docs and follow that link to the actual file on the hise.audio website.

            clevername27C 1 Reply Last reply Reply Quote 1
            • clevername27C
              clevername27 @aaronventure
              last edited by

              @aaronventure Thank you. Could you possibly show a code outline of how I'd do that — writing an event list to encoded file, and then decoding it? I'm little unclear. Cheers.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              55

              Online

              1.7k

              Users

              11.7k

              Topics

              102.1k

              Posts