dev:010how:100sys:0300encmod

Routines for Encoding/Decoding

Module ENCMOD Routines for Encoding/Decoding

Description

Can be used for relatively secure Obfuscating/deobfuscating:
* Password/String - via StrDecode/StrEncode
* File/Stream - via StreamDecode/StreamEncode


Rules

Rule Name Additional
function StrDecode text method
function StrEncode text method
sub StreamDecode method
sub StreamEncode method

Rules Description and Comments

function StrDecode( in ArgStr text ) : text method

Decodes (deobfuscates) string that was encoded by StrEncode

ArgStr - encoded string to decode


function StrEncode( in ArgStr text ) : text method

Encodes (obfuscates) string using random numeric key from 1 to 99
Keeps key encoded as two last bytes
Can be decoded by StrDecode

ArgStr - string to encode


sub StreamDecode( inout ArgStm stream ) method

Decodes (deobfuscates) stream that was encoded by StreamEncode
Uses cache for more performant decoding of a same stream in the same session

ArgStm - encoded stream to decode. The stream changed in-place.


sub StreamEncode( inout ArgStm stream ) method

Encodes (Obfuscates) stream to save it in unreadable format
Can be used for file saving

Encoded stream contains the following metadata:
* MAC - signature of the stream
* Created on - timestamp of the encoded stream creation
* User - user that initiated encoding
* Transaction - transaction where the encoding took place

ArgStm - stream to encode. Stream is changed in-place.

dev/010how/100sys/0300encmod.txt · Last modified: 2024/04/05 10:10 (external edit)