GOLF(2gg)

πŸ“¦ version 601.4.41, in ubuntu questing

πŸ’– GOLF(2gg) β€” the one and only πŸ’–

okay bestie, welcome to GOLF(2gg), Development section, and today's main character is decrypt-data. buckle up, it's giving cryptography but make it cute ✨


✨ NAME ✨

decrypt-data β€” (encryption) πŸŽ€

πŸ¦‹ PURPOSE πŸ¦‹

Decrypt data. that's it. that's the whole job. slay πŸ’…

🧚 SYNTAX 🧚

decrypt-data <data> to <result> \
    [ input-length <input length> ] \
    [ binary [ <binary> ] ] \
    ( password <password> \
        [ salt <salt> [ salt-length <salt length> ] ] \
        [ iterations <iterations> ] \
        [ cipher <cipher algorithm> ] \
        [ digest <digest algorithm> ]
        [ cache ]
        [ clear-cache <clear cache> ) \
    [ init-vector <init vector> ]

lowkey a lot of clauses but like, each one has a purpose, i promise 🫢


🌸 DESCRIPTION 🌸

so decrypt-data will decrypt <data> which must have been encrypted with encrypt-data, or with other software using the same algorithms and clauses as specified. no mixing and matching, bestie, that's not the vibe 😭

if the input-length clause is not used, then the number of bytes decrypted is the length of <data> (see string-length); but if input-length is specified, then exactly <input length> bytes are decrypted. periodt. πŸ”₯

the password used for decryption is the string <password> (in the password clause) and it must match the password used in encrypt-data. if the salt clause is used, then the string <salt> must match the salt used in encryption. if the init-vector clause is used, then the string <init vector> must match the IV (initialization vector) used in encryption. and if the iterations clause is used, then <iterations> must match the number used in encryption. matching = mandatory, iykyk πŸ‘‘

the result of decryption lives in <result> (in the to clause). that's your output, your prize, your moment πŸ’–

⚠️ if data was encrypted in binary mode (see encrypt-data), you must decrypt it with the same, and if it wasn't, then you must not use it in decrypt-data either. the reason is obvious honestly β€” binary mode of encryption is encrypted data in its shortest form, and character mode (without binary, or if <binary> evaluates to false) is the same data converted to a hexadecimal string β€” so decryption must first convert such data back to binary before decrypting. not me explaining hex-to-binary lore at 2am πŸ’€

the cipher and digest algorithms (if specified as <cipher algorithm> and <digest algorithm> in the cipher and digest clauses respectively) must match what was used in encrypt-data. fr fr, no substitutions πŸ™ˆ

the cache clause is used to cache the result of key computation, so it is not computed each time decryption takes place πŸŽ€ while clear-cache allows the key to be re-computed every time <clear cache> evaluates to boolean true. re-computation of a key, if used, must match the usage during encryption. for more on the cache and clear-cache clauses, as well as the safety of encrypting/decrypting, see "Caching key" and "Safety" in encrypt-data. go read it, bestie, it's important 🫢


πŸŽ€ EXAMPLES πŸŽ€

See encrypt-data. (yes really, that's where the examples are living, go visit them πŸ¦‹)


🌈 SEE ALSO 🌈

  • Encryption
  • decrypt-data
  • derive-key
  • encrypt-data
  • hash-string
  • hmac-string
  • random-crypto
  • random-string
  • See all documentation

and that's the whole page, bestie!! πŸ’œ this absolute icon of a manpage is brought to you by the $VERSION edition, dated $DATE, and yes, it's still filed under GOLF(2gg) because legends never leave their section πŸŽ€βœ¨πŸ’…

πŸ“¦ where this page comes from