Re: File Attachment Feature in V3 Format
Mark McGuill <[email protected]> Sun, 7 Oct 2018 10:03:18 +0200
| Newsgroups | gmane.comp.security.passwordsafe.devel |
|---|---|
| Message-ID | <CAHb=2jd_V8KahCw_oNNxBPRJfAsBmFS8WQJQskBja5FAd1WKqw@mail.gmail.com> |
--===============2957457907598831276== Content-Type: multipart/alternative; boundary="00000000000031d24d05779ef2a8" --00000000000031d24d05779ef2a8 Content-Type: text/plain; charset="UTF-8" Ok thanks Rony, I'll hopefully get to work on this shortly. Cheers, -Mark On Sat, 6 Oct 2018 at 16:49, pwsafe.org <[email protected]> wrote: > Hi Mark, > > An argument could be made that an evolutionary approach such you propose > is best. > > Even if you don't reuse the V4 core code, you might be able to use (and > improve?) the classes used to manage and display attachments. > > If you care to submit a pull request on the Github repo, I'll start a > separate "V3Att" branch so that others can review / contribute before > merging into master and releasing this to the public. > > Thanks, > > Rony > > On Sun, Sep 30, 2018 at 4:41 PM Mark McGuill <[email protected]> > wrote: > >> 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 >> _______________________________________________ >> Passwordsafe-devel mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/passwordsafe-devel >> > > > -- > Ubi dubium, ibi libertas (where there is doubt, there is freedom) > --00000000000031d24d05779ef2a8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Ok thanks Rony, I'll hopefully get to work on thi= s shortly. <br></div><div><br></div><div>Cheers,</div><div>-Mark<br></div><= /div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Sat, 6 Oct 2018 at = 16:49, <a href=3D"http://pwsafe.org">pwsafe.org</a> <<a href=3D"mailto:r= [email protected]">[email protected]</a>> wrote:<br></div><blockquote class= =3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd= ing-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-s= ize:small">Hi Mark,</div><div class=3D"gmail_default" style=3D"font-size:sm= all"><br></div><div class=3D"gmail_default" style=3D"font-size:small">An ar= gument could be made that an evolutionary approach such you propose is best= .</div><div class=3D"gmail_default" style=3D"font-size:small"><br></div><di= v class=3D"gmail_default" style=3D"font-size:small">Even if you don't r= euse the V4 core code, you might be able to use (and improve?) the classes = used to manage and display attachments.</div><div class=3D"gmail_default" s= tyle=3D"font-size:small"><br></div><div class=3D"gmail_default" style=3D"fo= nt-size:small">If you care to submit a pull request on the Github repo, I&#= 39;ll start a separate "V3Att" branch so that others can review /= contribute before merging into master and releasing this to the public.</d= iv><div class=3D"gmail_default" style=3D"font-size:small"><br></div><div cl= ass=3D"gmail_default" style=3D"font-size:small">Thanks,</div><div class=3D"= gmail_default" style=3D"font-size:small"><br></div><div class=3D"gmail_defa= ult" style=3D"font-size:small">=C2=A0 Rony</div></div><br><div class=3D"gma= il_quote"><div dir=3D"ltr">On Sun, Sep 30, 2018 at 4:41 PM Mark McGuill <= ;<a href=3D"mailto:[email protected]" target=3D"_blank">mark.mcguill@g= mail.com</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D= "margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D= "ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><= div dir=3D"ltr"><div>Hi,</div><div><br></div><div>I've just been chatti= ng with Rony over email about adding a feature to the V3 format to allow pe= ople 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 h= ere.</div><div><br></div><div>I maintain the Strongbox iOS and Mac app (<a = href=3D"https://strongboxsafe.com" target=3D"_blank">https://strongboxsafe.= com</a>), 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 o= f you feel the same.</div><div><br></div><div>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 us= ers, and I think it could be done in a way that would satisfy a lot of user= s. <br></div><div><br></div><div>As regards the performance given large fil= e sizes, I think that clients could help protect against this by imposing a= file size limit (perhaps 5-10MB), and explaining the consequences of addin= g many large files to the users. I've tested very large databases on iO= S devices, and had pretty good results, but of course your mileage will var= y, given the device and client implementations.</div><div><br></div><div>Ro= ny mentioned that it might be worth trying to back port the V4 work that ha= d 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/Roll= s Royce solution that would deal with the performance issues of large datab= ases very 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 m= odel, would require very little design changes, and I think could be a fair= ly straightforward implementation for other clients/platforms.<br></div><di= v><br></div><div>The idea is simply to create a new Record Field Type and s= ome kind 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> _______________________________________________<br> Passwordsafe-devel mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blan= k">[email protected]</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/passwordsafe-devel"= rel=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/l= istinfo/passwordsafe-devel</a><br> </blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"= class=3D"m_-1441130514571584006gmail_signature" data-smartmail=3D"gmail_si= gnature"><div dir=3D"ltr"><span style=3D"font-size:12.8px">Ubi dubium, ibi = libertas (where there is doubt, there is freedom)</span><br></div></div> </blockquote></div> --00000000000031d24d05779ef2a8-- --===============2957457907598831276== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============2957457907598831276== 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 --===============2957457907598831276==--