@Edent What, if any, security properties does your application require?
Do you need to prevent an attacker from producing a file with a specific hash value?
Do you need to prevent an attacker from producing two files with the same hash?
@Edent What, if any, security properties does your application require?
Do you need to prevent an attacker from producing a file with a specific hash value?
Do you need to prevent an attacker from producing two files with the same hash?
@ryanc I'm noodling around in a demo database - nothing prod facing.
But, this is to try and prevent an attacker producing a file with a specific hash.
So I'm assuming SHA over MD5?
@Edent There isn't any known attack against MD5 which would allow producing a file with a specific hash, but using it is very "fuck around and find out".
If you can't use BLAKE2/3 with a specified output size, use HMAC-SHA-256 with a fixed key such as "output truncated to 128 bits" to provide domain separation, then truncate.
There's some standard way to truncate SHA-256 to 128 bits, but I can't remember what spec it's in.
GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.
All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.