I'm using libsodium to encrypt files with xchacha20poly1305 construct. I got everything working correctly by following documentation (https://download.libsodium.org/doc/secret-key_cryptography/secretstream.html) but now I'm wondering about the role of header data.
crypto_secretstream_xchacha20poly1305_init_pull requires the header from crypto_secretstream_xchacha20poly1305_state that was used when the data was encrypted so how should I treat the header data? Is it same as AES' iv/nonce that it needs and can be to be distributed with the encrypted data as-is or is it secret like the key?
I realize this is most likely a newbie question but since I'm obviously not a crypto expect, I want to make sure I use libsodium and the construct right.
Thanks!
That's a pretty old question, but since it was still waiting for an answer, here it is.
The header is indeed a nonce. It doesn't have to be secret. But it is required so that if the same stream is encrypted twice, both ciphertexts will look completely different.
Related
This is a weird question I know, but it happened to be the only thing left stuck on my side project flow.
Okay, so I got this encrypted text on chain (encrypted with a public key I do not have). Now is it possible to validate the authenticity when someone uploads the "supposed" plaintext? Or is there something that the decrypter can provide in order for my contract to verify.
Thank you so much in advance, have been thinking about this for like three weeks.
I got a file that seems to not have anything readable into it (for a human)
How can I be sure that it hasn't anything readable for a human? Because it's way too large to read it entirely (maybe a program that searches for words or entropy or I don't know.)
How can I know if this file is compressed or encrypted, or both? And is it possible that it has a proprietary compression so I can't distinguish it from encryption?
Because if I can make sure that it's encrypted, I can stop my work directly, but if it's just encoded/compressed, maybe I can find a way to read it
(I tried to compress it with the basic Windows archiver and it loses 18% of its size. Does it mean that it's not encrypted? Does an encryption permit that much compression?)
Yes, it is certainly possible to create a compression format for which all possible sequences of bits is valid. In that case, you would not be able to distinguish the compressed data from random or encrypted data.
I am not aware of a commonly implemented compressed format that has that property. You could try all of the decompressors you can find on the data to see if any continue to decompress through all of the data without erroring out. You can also try starting at different locations in your data, since there may be some sort of header before the compressed data.
Online Decryption
If you would like to decrypt the file. You could simply copy and paste everything inside of https://online-toolz.com/tools/text-encryption-decryption.php
that feature can decrypt messages fast.
Encoder & Decoder
https://www.base64decode.org/
I found this website a while ago, this website is trusted and fast with great reviews.
This method can also help with your request.
I have a .aes file whose decryption password I thought I knew but which does not yield the decrypted version of the file.
I am 99.9% certain that the password I have (and which, in fact, I had written down and safely stored) is correct. The problem is that the .aes file was generated by a well-known open-source Bitcoin wallet software known as MultiBit which simply stopped working sometime in 2017, with many other users reporting similar problems.
I am told that Multibit may have incorrectly rendered some non alphanumeric characters of my password to whatever internal function it was using to generate the encrypted file. That means in practice that I could potentially crack my .aes file if I cycle through the permutations represented by the question marks in a password string that looks something like this:
i-AM-a-PASS?RD-with-3-UNKN?WN-charact?rs
So I guess my question is: is anyone aware of a regex-based brute-force approach that could be used for cracking .aes encryption passwords? The regex itself may need to employ both ? and * characters.
The amount of Bitcoin in the wallet was absolutely trivial, but with Musk's recent tweets sending Bitcoin to new highs I'm thinking I could buy a spanking new laptop if I can crack this.
Any suggestions most welcome.
Thanks,
So im trying to use a plugin called NSISCrypt for a NSIS Installer, Im wanting to obfuscate a register password.
So there are some easy Base64 encryption and decryption. So I thought HEY! great....
http://nsis.sourceforge.net/NsisCrypt_plug-in (He is the Readme for it)
Problem is Im not really sure what the Base64 iv is.....i've googled base64 iv and have come up with nothing.
Im not expert at encryption, however I understand what a Preshared Key is of course.....but what would a BaseIV be?
An initialization vector is a non secret, typically unique or random, generated data to help make encryption non deterministic when the same key is used. The docs there are just saying the IV needs to be base64 encoded.
so I want to generate some cached html files and I want to use some sort of encryption when naming them so they can't be easily accessed. Md5/Sha1,2 might be good alternatives but
I want something light something that would generate a string lets say 12 bytes long (just saying).
Is there anything similiar, available in php?
Thank you.
For obscurity through security purposes I would just use base64 or a simple random number based on seed, or a simple date maybe.
The thing is I don't see any cause for not using md5 as a performance hitter, though you can try crc32() which is basically a checksum calculator. If you insist on having anything else but sha1/md5 - you can also see this list here: http://www.php.net/manual/en/function.hash-algos.php and use the hash() function.
You can use uuid http://php.net/manual/en/function.uniqid.php to generate a unique name, but if you need to be able to reproduce the obfuscated name then your best bet is md5, speed shouldn't be an issue or whatever you refer to with "lightweight".
For something simple, but low security, have a look at the appropriate sized FNV hash. Once you have your hash as bytes, convert it to Base64 or whatever, as you wish.