Update

You can now encrypt plain text, so anything you want. With this, you can send sensitive information over insecure channels or share publicly with real plausible deniability. (below 2000 characters works without issue)

Changes

I rebuilt the system with a different encryption design, and address many of the flaws pointed out in V1.

I really wanted any password to always decrypt so you never know if you are right. I found the XOR algorithm that does this, but there is an entropy problem, where an incorrect password will almost always output non-common characters, I attempted to solve this at its core by diving into the math and some research papers but got nowhere, as it seemed to be almost impossible.

I tried finding an algorithm that would give me perfect plausible deniability, so if you shared a link X with a password you could use a different password and get Y, saying you never intended to share X. It doesn’t exist 😢 I came up with a workaround by adding decoys which are mutable XOR ciphers joined, it allows you to set what other data is included, so you can tailor your alibi.

Here is the demo link. There are three memes you can find

Password: test1, test2, test3

Safety

It should be safe to share data encrypted with this method, I did some basic brute force tests and did not find any shortcuts, I have a rough estimate of a billion years on a server farm for a 12digit password.

Considerations

@calcopiritus@lemmy.world said:

“There’s 2 secrets here: the link and the password. And to share it with someone you need to share 2 secrets: the locked link and the password.”

A strong password is almost impossible to crack, but you can use a popular text link tool like pastebin with expiry to mask the encrypted data. As for eliminating the password, I have considered using the site as the ‘shared secret’ so you share just the cipher, and if you know the URL you can paste it in, and it would be encrypted/decrypted with a derived key the site stored.

  • PlexSheep@infosec.pub
    link
    fedilink
    arrow-up
    23
    ·
    8 months ago

    What do you mean, the XOR Algorithm?? For this case, an AES-256 GCM AEAD (Authenticated Encryption, possibly with Associated Data) seems like the perfect use case. AES GCM is usually the most secure mode.

    I hope you didn’t literally use XOR, so like you have some key stream the length of your data, XOR the key stream with the data to get some output. This is what some modes do internally, like AES CBC, but for an application you should just use something from a stable crypto library.

    If anything, keep to Rule Number 1: Never do your own Crypto.

    • Hazelnoot [she/her]@beehaw.org
      link
      fedilink
      English
      arrow-up
      7
      ·
      edit-2
      8 months ago

      I hope you didn’t literally use XOR

      It’s XOR(key, block) with IV and chaining: https://github.com/RommieEcho/qrcatalyst-open/blob/main/src/routes/anon/XORCipher.js

      Since it’s chained at the byte level, you can strip it out by just XORing each byte against all following bytes. Then the IV can be XORed out of the first block, at which point you have just a series of XOR(key, plaintext) blocks that can be attacked with conventional methods.

      • PlexSheep@infosec.pub
        link
        fedilink
        arrow-up
        3
        ·
        8 months ago

        I get that coding cryptography is fun. I did it in university for the relevant classes where we had been given specific exercises, test vectors, in the second one even automatic testing with thousands of test cases, and speed mattered too. For education, that’s pretty amazing, but if you do your own Crypto and put it in production you’re just asking for trouble.

        This really is just an AES GCM case. And don’t understate the beauty of using a well formalized and thought out crypto primitive for actual applications. Cryptography is fucking cool.

      • AtHeartEngineer@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        ·
        8 months ago

        If you like experimenting with cryptography check out circom, it’s a relatively simple language to program zero knowledge cryptography. I was the head of development at a programmable cryptography research and development organization for a bit, it’s fun stuff, we researched and experimented with zero knowledge proofs, multi-party computation, and some more far fetched stuff like fully homomorphic encryption and indistinguishablility obfuscation. What you are trying to do definitely can be done with zk.

        Also, please never use xor again lol

  • litchralee@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    19
    arrow-down
    2
    ·
    edit-2
    8 months ago

    Setting aside the cryptographic merits (and concerns) of designing your own encryption, can you explain how a URL redirector requiring a key would provide plausible deniability?

    The very fact that a key is required – and that there’s an option for adding decoy targets – means that any adversary could guess with reasonable certainty that the sender or recipient of such an obfuscated link does in-fact have something to hide.

    And this isn’t something like with encrypted messaging apps where the payload needs to be saved offline and brute-forced later. Rather, an adversary would simply start sniffing the recipient’s network immediately after seeing the obfuscated link pass by in plain text. What their traffic logs would show is the subsequent connection to the real link, and even if that’s something protected with HTTPS – perhaps https://ddosecrets.com/ – then the game is up because the adversary can correctly deduce the destination from only the IP address, without breaking TLS/SSL.

    This is almost akin to why encrypted email doesn’t substantially protect the sender: all it takes is someone to do a non-encryted reply-all and the entire email thread is sent in plain text. Use PGP or GPG to encrypt attachments to email if you must, or just use Signal which Just Works ™ for messaging. We need not reinvent the wheel when it’s already been built. But for learning, that’s fine. Just don’t use it in production or ask others to trust it.

    • RommieDroid@programming.devOP
      link
      fedilink
      arrow-up
      5
      ·
      8 months ago

      Hey, thanks for the thoughtful breakdown. I probably should label it: warning random IT grad project. I mistakenly believed I could make something that was good, well it’s a lot more difficult. You’re right that this doesn’t provide the kind of plausible deniability I initially hoped for, the decoys were just a workaround, because I couldn’t find the type of algorithm I wanted.

      The query parameters are masked with HTTPS so you’re not revealing any extra data, it would just look like any other redirect if you were packet sniffing. And when visiting the destination links, your normal OPSEC still applies, like changing your DNS, using a VPN, etc. I was just seeing if this project would find some sort of use, but I only spend two days on it and it was a fun learning experience.

      • Jack Riddle[Any/All]@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        4
        ·
        8 months ago

        I would encourage rolling your own crypto for fun, because, well, it is. But yeah, you should maybe also make clear that people should not use it, because that is rule 1 of cryptography.

    • communism@lemmy.ml
      link
      fedilink
      arrow-up
      3
      ·
      8 months ago

      I was also confused at first, but OP is using “plausible deniability” to mean “depending on what decryption key you attempt to use, you get different ‘decrypted’ data”, so you can have an alibi I suppose. Not “plausible deniability” in the sense of “plausibly this isn’t encrypted at all”.