Haskell Encryption

Haskell Encryption

Haskell is a pure functional language loved for strong types, lazy evaluation, and expressiveness in compilers, research tools, and a modest slice of industry services. GHC produces native binaries; you still get string tables in the output like any other compiled language.

Smaller teams sometimes embed signing secrets or internal service URLs while prototyping. StringEncrypt outputs Haskell that rebuilds those strings at runtime (note: the engine’s nested-loop mode skips Haskell, but the standard instruction set still applies).

String encryption supports both UNICODE and ANSI strings.

You can read more about Haskell and Haskell strings at:

Haskell encryption (UNICODE Example)

Plaintext reference: StringEncrypt sample

The Haskell backend emits a flat command chain (no inner loops); other language samples use nested inner loops with the same plaintext.

-- encrypted with https://www.stringencrypt.com (v1.5.0) [Haskell]
module Main where

import qualified Data.Char
import qualified Data.Bits

main = do
  putStrLn $ myString

-- myString = "StringEncrypt sample"
myString = zipWith f [0..] [ 0x14C3, 0xD942, 0x727E, 0x2573, 0xCA27, 0x9549, 0x35D3, 0x50D7,
                             0xBB8C, 0x5630, 0x5D08, 0x785A, 0xCEBE, 0x3182, 0x451D, 0x424E,
                             0xA4A9, 0x1959, 0xB2D8, 0x2500 ]
  where
    f kugka cspha = let xivlg0 = cspha
                       xivlg1 = xivlg0 + kugka
                       xivlg2 = Data.Bits.rotateR xivlg1 kugka
                       xivlg3 = Data.Bits.complement xivlg2
                       xivlg4 = xivlg3 `Data.Bits.xor` kugka
                       xivlg5 = xivlg4 - 0x1CA9
                       xivlg6 = negate xivlg5
                       xivlg7 = xivlg6 `Data.Bits.xor` (Data.Bits.shiftL xivlg6 11 Data.Bits..&. 0xFFFF)
                       xivlg8 = Data.Bits.complement xivlg7
                       xivlg9 = xivlg8 `Data.Bits.xor` 0xA6C1
                    in Data.Char.chr (xivlg9 Data.Bits..&. 0xFFFF)

Haskell encryption (ANSI Example)

Plaintext reference: StringEncrypt sample

-- encrypted with https://www.stringencrypt.com (v1.5.0) [Haskell]
module Main where

import qualified Data.Char
import qualified Data.Bits

main = do
  putStrLn $ myString

-- myString = "StringEncrypt sample"
myString = zipWith f [0..] [ 0xD1, 0x61, 0xE9, 0x74, 0x72, 0x93, 0xB2, 0x2E,
                             0xC9, 0x7D, 0x0D, 0x50, 0x18, 0xB0, 0xC0, 0xDD,
                             0x07, 0xEC, 0xAC, 0xC6 ]
  where
    f gnoge qyrgg = let piejy0 = qyrgg
                       piejy1 = Data.Bits.rotateR piejy0 gnoge
                       piejy2 = piejy1 `Data.Bits.xor` 0xDD
                       piejy3 = piejy2 - 1
                       piejy4 = piejy3 `Data.Bits.xor` (Data.Bits.shiftL piejy3 6 Data.Bits..&. 0xFF)
                       piejy5 = Data.Bits.rotateR piejy4 gnoge
                       piejy6 = piejy5 - 1
                       piejy7 = piejy6 - 0x82
                       piejy8 = Data.Bits.rotateR piejy7 gnoge
                       piejy9 = piejy8 - gnoge
                       piejy10 = piejy9 `Data.Bits.xor` Data.Bits.shiftR piejy9 4
                       piejy11 = piejy10 `Data.Bits.xor` (Data.Bits.shiftL piejy10 5 Data.Bits..&. 0xFF)
                       piejy12 = piejy11 + gnoge
                       piejy13 = Data.Bits.rotateL piejy12 gnoge
                       piejy14 = piejy13 + gnoge
                       piejy15 = piejy14 - 0x79
                    in Data.Char.chr (piejy15 Data.Bits..&. 0xFF)