INNER CODE UNIT · JavaScript

wrapEnd

jofpin/temcrypt · temcrypt.js:305

            const wrapEnd = invertedWrapper.substring(invertedWrapper.length - this.baseTime().seconds);
            // Concatenate the wrapped portions with the middle part of the invertedWrapper to form the final encrypted data.
            const formedLayers = wrapEnd + invertedWrapper.substring(this.baseTime().seconds, invertedWrapper.length - this.baseTime().seconds) + wrapStart;

            return formedLayers;
        },
        _encryptableString: function(string, mainKey, extraBytes) {
            if (!string && !mainKey) {
                throw new Error("Both string and key are required");
            }
            if (!string) {
                throw new Error("string cannot be empty");
            }

            mainKey = mainKey || this.shadowToken();

            const shadowToken = this.shadowToken();
            const encryptedGhostLayer = this.helper(string).enc256(shadowToken + this.baseTime().minutes);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…