Implementing a SHA-256 hashing algorithm?



  • Hello. For my science fair project, I developed a protocol that utilizes hashing as a means of ongoing Cryptographic Key generation. Using existing blocks in Netsblox, I cannot seem to recreate or adapt hashing in any capacity from its origins in Java. I tried to use the custom block function thinking that it would let me code Java into a block directly, but it required me to use existing Netsblox blocks. I have checked as many libraries as I could find, but none of them had what I needed. The closest I could find was an obscure "encrypt" block.

    My questions are:

    1. Is it possible to use Java to code in blocks in Netsblox? Or do I have to use only existing blocks? If I have to use existing blocks, can you point me in the direction how to do this (resources to read etc)?
    2. If it is not possible to use Java specifically, does anyone know how to code, or has already coded, a hashing algorithm that I can use in Netsblox?
    3. If Netxblox is not the appropriate platform for what I want to do, is there another, better, platform that will allow me to code for the hashing protocol I have developed?

  • administrators

    [0_1563630859187_sha256.zip](Uploading 0%) Sounds like a cool project! Java code cannot be used directly in NetsBlox but JavaScript can (using the "Javascript function" block under the "Operators" tab). This could be used to either implement sha-256 in JS yourself or to load a JS library providing this functionality.

    I have attached an example which uses the implementation provided at https://geraintluff.github.io/sha256/ to provide a custom block for computing the SHA-256 hash. sha256.xml