File Attachment Feature in V3 Format
Mark McGuill <[email protected]> Sun, 30 Sep 2018 13:41:43 +0000
| Newsgroups | gmane.comp.security.passwordsafe.devel |
|---|---|
| Message-ID | <CAHb=2je0UAr34uP=Qm2awnowjfWHzZd5Apfw_67EiLrTp8H6ow@mail.gmail.com> |
--===============6614127297790817751==
Content-Type: multipart/alternative; boundary="0000000000008a2d47057716dba0"
--0000000000008a2d47057716dba0
Content-Type: text/plain; charset="UTF-8"
Hi,
I've just been chatting with Rony over email about adding a feature to the
V3 format to allow people to store files (e.g. images, etc) as part of a
record. He suggested it was best to mail this list with the idea, and see
what your thoughts are here.
I maintain the Strongbox iOS and Mac app (https://strongboxsafe.com), which
are Password Safe clients. I get frequent feature requests from people to
allow them to add images or attachments to their safes. This is a feature
I'd like myself for my own safes too, I'm sure some of you feel the same.
Rony had some concerns about performance, which I think are worth
discussing. Also, I know that as part of V4 there is some expected support
for file attachments. I think however that getting this feature in V3 would
be a big win for all password safe users, and I think it could be done in a
way that would satisfy a lot of users.
As regards the performance given large file sizes, I think that clients
could help protect against this by imposing a file size limit (perhaps
5-10MB), and explaining the consequences of adding many large files to the
users. I've tested very large databases on iOS devices, and had pretty good
results, but of course your mileage will vary, given the device and client
implementations.
Rony mentioned that it might be worth trying to back port the V4 work that
had been done on this feature, into V3. I haven't had a chance to take a
look at the feasibility of this just yet, it seems like a full
service/Rolls Royce solution that would deal with the performance issues of
large databases very well.
Separately, I had my own idea of how to do this, that while not as robust
and performant as Rony's model, would require very little design changes,
and I think could be a fairly straightforward implementation for other
clients/platforms.
The idea is simply to create a new Record Field Type and some kind of
(pseudo code) data structure like so:
typedef struct _FileAttachment {
char fileNameLength[4]; // 4 hexadecimal digit file name length (in
TCHAR) - Password History Style Length
char mimeTypeLength[4]; // 4 hexadecimal digit mime type length (in
TCHAR) - Password History Style Length
char filename[...]; // The file name
char mimeType[...]; // a mime type such as 'image/jpeg' - to aid
with opening / encoding / display etc
unsigned char data[]; // The actual data of the file filled out to
the end of the field
} FileAttachment;
I hope that makes sense. Would love to hear your thoughts. I think this
could be a great feature for the Password Safe format.
Thanks and all the best,
-Mark
--0000000000008a2d47057716dba0
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div di=
r=3D"ltr"><div dir=3D"ltr"><div>Hi,</div><div><br></div><div>I've just =
been chatting with Rony over email about adding a feature to the V3 format =
to allow people to store files (e.g. images, etc) as part of a record. He s=
uggested it was best to mail this list with the idea, and see what your tho=
ughts are here.</div><div><br></div><div>I maintain the Strongbox iOS and M=
ac app (<a href=3D"https://strongboxsafe.com">https://strongboxsafe.com</a>=
), which are Password Safe clients. I get frequent feature requests from pe=
ople to allow them to add images or attachments to their safes. This is a f=
eature I'd like myself for my own safes too, I'm sure some of you f=
eel the same.</div><div><br></div><div>Rony had some concerns about perform=
ance, which I think are worth discussing. Also, I know that as part of V4 t=
here is some expected support for file attachments. I think however that ge=
tting this feature in V3 would be a big win for all password safe users, an=
d I think it could be done in a way that would satisfy a lot of users. <br>=
</div><div><br></div><div>As regards the performance given large file sizes=
, I think that clients could help protect against this by imposing a file s=
ize limit (perhaps 5-10MB), and explaining the consequences of adding many =
large files to the users. I've tested very large databases on iOS devic=
es, and had pretty good results, but of course your mileage will vary, give=
n the device and client implementations.</div><div><br></div><div>Rony ment=
ioned that it might be worth trying to back port the V4 work that had been =
done on this feature, into V3. I haven't had a chance to take a look at=
the feasibility of this just yet, it seems like a full service/Rolls Royce=
solution that would deal with the performance issues of large databases ve=
ry well. <br></div><div><br></div><div>Separately, I had my own idea of how=
to do this, that while not as robust and performant as Rony's model, w=
ould require very little design changes, and I think could be a fairly stra=
ightforward implementation for other clients/platforms.<br></div><div><br><=
/div><div>The idea is simply to create a new Record Field Type and some kin=
d of (pseudo code) data structure like so:</div><div><br></div>
<p class=3D"MsoNormal" style=3D"margin:0cm 0cm 0.0001pt;font-size:12pt;font=
-family:"Calibri",sans-serif"><span style=3D"font-size:10pt;font-=
family:Menlo;color:rgb(170,13,145)" lang=3D"EN-US">typedef</span><span styl=
e=3D"font-size:10pt;font-family:Menlo;color:black" lang=3D"EN-US">
</span><span style=3D"font-size:10pt;font-family:Menlo;color:rgb(170,13,145=
)" lang=3D"EN-US">struct</span><span style=3D"font-size:10pt;font-family:Me=
nlo;color:black" lang=3D"EN-US"> _FileAttachment {</span><span style=3D"fon=
t-family:Helvetica" lang=3D"EN-US"><span></span></span></p>
<p class=3D"MsoNormal" style=3D"margin:0cm 0cm 0.0001pt;font-size:12pt;font=
-family:"Calibri",sans-serif"><span style=3D"font-size:10pt;font-=
family:Menlo;color:black" lang=3D"EN-US"><span>=C2=A0=C2=A0=C2=A0 </span></=
span><span style=3D"font-size:10pt;font-family:Menlo;color:rgb(170,13,145)"=
lang=3D"EN-US">char</span><span style=3D"font-size:10pt;font-family:Menlo;=
color:black" lang=3D"EN-US"> fileNameLength[</span><span style=3D"font-size=
:10pt;font-family:Menlo;color:rgb(28,0,207)" lang=3D"EN-US">4</span><span s=
tyle=3D"font-size:10pt;font-family:Menlo;color:black" lang=3D"EN-US">];=C2=
=A0=C2=A0 </span><span style=3D"font-size:10pt;font-family:Menlo;color:rgb(=
0,116,0)" lang=3D"EN-US">// 4 hexadecimal digit file name length
(in TCHAR) - Password History Style Length</span><span style=3D"font-family=
:Helvetica" lang=3D"EN-US"><span></span></span></p>
<p class=3D"MsoNormal" style=3D"margin:0cm 0cm 0.0001pt;font-size:12pt;font=
-family:"Calibri",sans-serif"><span style=3D"font-size:10pt;font-=
family:Menlo;color:black" lang=3D"EN-US"><span>=C2=A0=C2=A0=C2=A0 </span></=
span><span style=3D"font-size:10pt;font-family:Menlo;color:rgb(170,13,145)"=
lang=3D"EN-US">char</span><span style=3D"font-size:10pt;font-family:Menlo;=
color:black" lang=3D"EN-US"> mimeTypeLength[</span><span style=3D"font-size=
:10pt;font-family:Menlo;color:rgb(28,0,207)" lang=3D"EN-US">4</span><span s=
tyle=3D"font-size:10pt;font-family:Menlo;color:black" lang=3D"EN-US">];=C2=
=A0=C2=A0 </span><span style=3D"font-size:10pt;font-family:Menlo;color:rgb(=
0,116,0)" lang=3D"EN-US">// 4 hexadecimal digit mime type length
(in TCHAR) - Password History Style Length</span><span style=3D"font-family=
:Helvetica" lang=3D"EN-US"><span></span></span></p>
<p class=3D"MsoNormal" style=3D"margin:0cm 0cm 0.0001pt;font-size:12pt;font=
-family:"Calibri",sans-serif"><span style=3D"font-size:10pt;font-=
family:Menlo;color:black" lang=3D"EN-US"><span>=C2=A0=C2=A0=C2=A0 </span></=
span><span style=3D"font-size:10pt;font-family:Menlo;color:rgb(170,13,145)"=
lang=3D"EN-US">char</span><span style=3D"font-size:10pt;font-family:Menlo;=
color:black" lang=3D"EN-US"> filename[...];<span>=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 </span></span><span style=3D"font-size:10pt;font-family:Menlo;=
color:rgb(0,116,0)" lang=3D"EN-US">// The file
name</span><span style=3D"font-family:Helvetica" lang=3D"EN-US"><span></spa=
n></span></p>
<p class=3D"MsoNormal" style=3D"margin:0cm 0cm 0.0001pt;font-size:12pt;font=
-family:"Calibri",sans-serif"><span style=3D"font-size:10pt;font-=
family:Menlo;color:black" lang=3D"EN-US"><span>=C2=A0=C2=A0=C2=A0 </span></=
span><span style=3D"font-size:10pt;font-family:Menlo;color:rgb(170,13,145)"=
lang=3D"EN-US">char</span><span style=3D"font-size:10pt;font-family:Menlo;=
color:black" lang=3D"EN-US"> mimeType[...];<span>=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 </span></span><span style=3D"font-size:10pt;font-family:Menlo;=
color:rgb(0,116,0)" lang=3D"EN-US">// a mime type
such as 'image/jpeg' - to aid with opening / encoding / display etc=
</span><span style=3D"font-family:Helvetica" lang=3D"EN-US"><span></span></=
span></p>
<p class=3D"MsoNormal" style=3D"margin:0cm 0cm 0.0001pt;font-size:12pt;font=
-family:"Calibri",sans-serif"><span style=3D"font-size:10pt;font-=
family:Menlo;color:black" lang=3D"EN-US"><span>=C2=A0=C2=A0=C2=A0 </span></=
span><span style=3D"font-size:10pt;font-family:Menlo;color:rgb(170,13,145)"=
lang=3D"EN-US">unsigned</span><span style=3D"font-size:10pt;font-family:Me=
nlo;color:black" lang=3D"EN-US"> </span><span style=3D"font-size:10pt;font-=
family:Menlo;color:rgb(170,13,145)" lang=3D"EN-US">char</span><span style=
=3D"font-size:10pt;font-family:Menlo;color:black" lang=3D"EN-US"> data[];<s=
pan>=C2=A0=C2=A0=C2=A0=C2=A0 </span></span><span style=3D"font-size:10pt;fo=
nt-family:Menlo;color:rgb(0,116,0)" lang=3D"EN-US">// The actual data of th=
e file filled out to the end of the field</span><span style=3D"font-family:=
Helvetica" lang=3D"EN-US"><span></span></span></p>
<p class=3D"MsoNormal" style=3D"margin:0cm 0cm 0.0001pt;font-size:12pt;font=
-family:"Calibri",sans-serif"><span style=3D"font-size:10pt;font-=
family:Menlo;color:black" lang=3D"EN-US">} FileAttachment;</span></p><p cla=
ss=3D"MsoNormal" style=3D"margin:0cm 0cm 0.0001pt;font-size:12pt;font-famil=
y:"Calibri",sans-serif"><br><span style=3D"font-size:10pt;font-fa=
mily:Menlo;color:black" lang=3D"EN-US"></span><span></span></p>
<div>I hope that makes sense. Would love to hear your thoughts. I think thi=
s could be a great feature for the Password Safe format.</div><div><br></di=
v><div>Thanks and all the best,<br></div><div>-Mark<br></div></div></div></=
div></div></div></div>
--0000000000008a2d47057716dba0--
--===============6614127297790817751==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--===============6614127297790817751==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Passwordsafe-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/passwordsafe-devel
--===============6614127297790817751==--