-
nicoco
lovetox, which client did that? I guess this is in relation to my "unnamed-chat" merge request, right?
-
lovetox
i think conversations
-
wgreenhouse
yeah, C-family clients do this at least for MUCs configured as private invite-only
-
wgreenhouse
I forget if they also do for intended public MUCs
-
MattJ
They display it? Or they actually *configure* it?
-
lovetox
either they set the bug mark or configure it on the muc
-
lovetox
but that i was confronted with this was probably years ago
-
lovetox
hence my question if someone still does this
-
lovetox
hmm other question if there is a file hash like in https://xmpp.org/extensions/xep-0447.html
-
lovetox
is this the hash of the encrypted file (if we encrypt with aes for omemo) or the unencrypted?
-
lovetox
i can see arguments for both ..
-
lovetox
hmm but i guess it should be the unencrypted, because thats how it ends up on the harddrive in the end
-
moparisthebest
gotta be the hash of the file actually shared, so after encryption in that case
-
lovetox
why?
-
moparisthebest
Because that's the file shared
-
moparisthebest
Plus leaking the hash of the unencrypted file sounds dangerous
-
lovetox
so the only purpose of this hash is to check if the file transfer was complete?
-
moparisthebest
and/or not have to re-download if you already have it
-
lovetox
but thats not possible then or?
-
lovetox
the hash of a encrypted file is on every filetransfer different
-
lovetox
so you can never check
-
moparisthebest
it can be, or the same encrypted file could be shared right?
-
lovetox
sounds unrealistic
-
lovetox
why would someone keep an encrypted file on harddisk to reshare it
-
singpolyma
Could share using same url
-
lovetox
this is not a question of if it would be possible to share the same encrypted file multiple times
-
lovetox
the problem is, this definitly a edge case that you would see the same encrypted file twice
-
moparisthebest
I don't know why it would be
-
lovetox
because i dont know any client that can do this?
-
moparisthebest
it doesn't really matter though, the hash can't be of the file before encryption because that wouldn't work and more importantly wouldn't be safe
-
lovetox
because my implementation could also not do this
-
moparisthebest
clients aren't the whole world
-
lovetox
yeah and nobody talked about the world, except you just now
-
moparisthebest
you said you didn't know any clients that did this /shrug
-
lovetox
but anyway .. if its the one after encryption then its much less useful .. need to think if i even store it then
-
moparisthebest
'447 can't even be used with encryption can it
-
lovetox
yes if i say something is an "edge case" meaning it does not happen a lot, and you say the opposite, then i would assume you have excamples how ans where this often happens✎ -
lovetox
yes if i say something is an "edge case" meaning it does not happen a lot, and you say the opposite, then i would assume you have excamples how and where this often happens ✏
-
moparisthebest
By that definition all of '447 is an edge case cause nothing uses it lol
-
lovetox
there are already multiple clients using, dino, kaidan e.g.
-
lovetox
and also the hash is not only in 447
-
lovetox
its also in SIMS which cheogram uses
-
lovetox
btw, 447 can be used with encryption, you just need omemo2
-
moparisthebest
kaidan can because it's the only client that does SCE right?
-
lovetox
447 could also be used when you dont include metadata about the file or?
-
lovetox
all metadata attributes are optional
-
lovetox
ah no
-
lovetox
im an idiot, yes you need full stanza
-
lovetox
key is in the link
-
lovetox
dino uses it probably only unencrypted
-
lovetox
as will gajim for now
-
moparisthebest
so if the hash is encrypted such that the server can't see it it would be safe to send the hash of the unencrypted file 🤔
-
lovetox
> essential as they provide end-to-end file integrity and allow efficient caching and flexible retrieval methods.
-
lovetox
so if caching is the described use case i need to store the hash
-
lovetox
and because gajim does not yet support full stanza i delay the decision what to do about encrypted files
-
lovetox
maybe i send a mail to the list
-
theTedd
The hash is of the original file content (unencrypted). Revealing a hash value tells you nothing about the file or its contents, unless: you already have the file to match its hash value, or a weak hashing method is used that allows a reversal (which, even then, doesn't uniquely give the original data for files of any reasonable size)
-
lovetox
its not revealed anyway, because the stanza is encrypted. But its undefined as i see it
-
singpolyma
I don't see how hashing "before encryption" would make any sense. it should be a hash of the file being transferred. the encrypted file is the file being transferred. from the pov of SIMS/SFS the unencrypted file doesn't exist
-
lovetox
it definitly does not exist for these XEPs or they would have included text about it
-
lovetox
but only because the authors didnt think of something, means not we can do it not now
-
singpolyma
it would be a layer violation to do it that way anyway
-
theTedd
That's a question of whether you're putting encryption above or below SFS. SFS doesn't consider encryption because it's a separate layer.
-
lovetox
exactly, i place it above SFS
-
lovetox
we create a SFS stanza, afterwards we encrypt it
-
theTedd
Right, so the hash value is before any encryption is applied
-
singpolyma
for the stanza encryption sure. but you have to encrypt the file first before you get to the SIMS/SMS/OOB/HTTP upload
-
lovetox
but thats not a layer violation as i see it
-
lovetox
if SFS is about unencrypted files, i put data in it about unencrypted fiels✎ -
lovetox
if SFS is about unencrypted files, i put data in it about unencrypted files ✏
-
theTedd
All of the metadata is for the unencrypted file (because it's meaningless for an encrypted file)
-
lovetox
yeah but anyway, nobody can be right or wrong about this, its defintily something that was not thought about
-
lovetox
and its not a clear cut case
-
singpolyma
> All of the metadata is for the unencrypted file (because it's meaningless for an encrypted file) this makes no sense. there is no unencrypted file ↺
-
singpolyma
the file that is to be uploaded/transferred may be encrypted or not using any mechanism or not which the transfer layer has no knowledge of
-
lovetox
i mean we can add omemo specific elements into SFS, so SFS knows about the encryption
-
lovetox
would make it probably a bit cleaner
-
lovetox
but not much different for the clients who receive the file, they know anyway
-
singpolyma
sure. you could do that. that feels like a very different sort of thing and I think it's a bad idea, but it's definitely not how it is now
-
singpolyma
well, not omemo specific since you can't encrypt files with omemo. but yes I get your meaning
-
lovetox
https://xmpp.org/extensions/xep-0396.html
-
lovetox
its also not defined there
-
theTedd
> The hash elements provide end-to-end file integrity and allow efficient caching and flexible retrieval methods. End-to-end means you only have the original data at either end, i.e. it's the original unencrypted data. Efficient caching doesn't work well for encrypted data.
-
singpolyma
> https://xmpp.org/extensions/xep-0396.html this is transport encryption so I guess in this case there is no encrypted file at all ↺
-
lovetox
so .. the hash would be of the unencrypted file
-
singpolyma
in that case yes. since that's all that exists
-
lovetox
you just need to see the upload as transport encryption :)
-
lovetox
but yeah i agree, its ugly ..
-
singpolyma
I mean the whole "encrypted file" concept was suppose to be a temporary hack. But temporary solutions have a way of sticking around ;)
-
lovetox
how would you solve it differently with http?
-
theTedd
Whether you upload an encrypted version of the file, or send it over an encrypted stream, that's all just a transport method; SFS is concerned with the original file.
-
lovetox
i mean if you design it not as a hack
-
singpolyma
if we had a way to transport encrypted with http upload I'd agree I think
-
lovetox
singpolyma, for me its clear that the hash of the unencrypted file, benefits clients more. So how would you suggest to get there?
-
lovetox
staying on a point, just out of principle is not a good solution
-
singpolyma
let me read the aesgcm xep again
-
lovetox
yeah i mean putting the fragment in the link etc is not pretty, lets imagine we would create a XEP who fixes that, then we would probably add a <encrypted> element or something to the stanza, and would transport the key there
-
lovetox
but it would be reeeeaallly weird if we put then the unencrypted hash into the <encrypted> element as metadata :D
-
lovetox
at this point you would say, but the encrypted hash in the <encrypted> element, and SFS has the unencrypted✎ -
lovetox
at this point you would say, put the encrypted hash in the <encrypted> element, and SFS has the unencrypted ✏
-
singpolyma
the trick is that you only need the key for some of the transports in a multi-transport case. Like if I had Jingle FT and HTTP upload both I could have security on the jingle case using another mechanism and not need a key in the file transfer for that
-
singpolyma
so instead of <url>...</url><key>...</key> you need more like <url key="...">...</url> which is basically what we get now with aesgcm://
-
singpolyma
so maybe if you squint you could consider xep0454 a transport mechanism and then theTedd would be right, hmm. It's not really written that way and I don't think anyone implements it that way, but it sort of is one
-
singpolyma
so maybe we could reword 0454 to be more clear about this, that this is a weird transport mechanism and the file being transferred is still the "unencrypted" file even if http upload layer deals exclusively with the encrypted file
-
lovetox
yeah i think, we have a encryption layer, its not pretty and clear shown in the stanzas and xml, but it is effectivly a layer, and we should not leak this encryption data into SFS only because we have no pretty layer
-
moparisthebest
> The hash is of the original file content (unencrypted). Revealing a hash value tells you nothing about the file or its contents, unless: you already have the file to match its hash value, or a weak hashing method is used that allows a reversal (which, even then, doesn't uniquely give the original data for files of any reasonable size) it reveals at least what you said, and at least one other I can think of: 1. The hash is known - some-pirated-movie.mp4 or snowden-leak.txt or whatever 2. If the same file is uploaded multiple times by the same or different people, these encrypted versions are different but the hash reveals they are the same file those alone are enough to never do it, and there are probably more ↺