3 ms·
Why bother encrypting the fragment of the URL at all? Anyone who has the text of the URL gets the message, whether the fragment is encrypted or not. Encryption
by rerdavies 3y ago
Why bother encrypting the fragment of the URL at all? Anyone who has the text of the URL gets the message, whether the fragment is encrypted or not. Encryption is just obfuscation.
An even better way to do this would be to use a data: URL instead. That avoids risks associated with a compromised web server.
data:,Put your secret message here.
Even better still: just put the message in plain text on a piece of paper. That avoids risks associated with a compromised browser.
Am I missing something?
- prophesi 3y ago> Encryption is just obfuscation. This is what you're missing. Obfuscation is not encryption, and anyone with access to the encrypted data in the URL would not be able to crack it in a reasonable amount of time unless they know something we don't know about public key encryption and SubtleCrypto's implementation of it. edit: and the problem it's trying to solve are to reach people that you can't just hand a slip of paper of what you want to tell them.
- rerdavies 3y agoIn this case, you crack the encryption by cutting and pasting the URL into your browser's address bar. Navigate to the link, and you get the decrypted message. It is encryption as theatre. Non-functional encryption. Encryption that hides nothing.
- prophesi 3y agoNo, only if your browser has the right private key. Let's say User A goes to the Corgea site. Their browser generates an RSA keypair, and appends the _public key_ to the URL, which is supposed to be visible. When User B accesses that URL, User B's device generates an RSA keypair, and encrypts their message using User A's public key and User B's private key. User B's generated URL will now contain User B's public key and the aforementioned encrypted message. User A decrypts using User B's public key and User A's private key. tl;dr: Each browser client generates a keypair, and their private key is never exposed. You only ever encrypt/decrypt with _your_ private key, and someone else's public key.
- lkbm 3y agoThis presumably uses something like Diffie-Hellman[0]. Getting the URL isn't enough to decrypt the message. Even if you intercept 100% of the data passed between the two users, they still end up with information that you don't. Now if you intercept and replace the URL, they may be in trouble. [0] https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exc...
- lkbm 3y agoI guess technically they don't have information you don't have, but they have it in a usable form—e.g., they have two prime numbers and you just have the product.