Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
martinbach #1
Member since Mar 2009 · 60 posts
Group memberships: Members, Premium
Show profile · Link to this post
Subject: How to write/read a compressed or zipped string to an  xml element
Hi Alex,

I'd like to write a compressed or zipped (own algorithm) part of an xmpp-xml tree in an xml element as its value.
transport it over the net, decompress the compressed xmpp-xml tree and use the whole tree as normal xmpp xml in my code.

 e.g.

<Person>
    <Lastname>Bach<Lastname>
    <Age>42</Age>          
    <CompressedAddress>
         compressed_xml_tree_string
    <CompressedAddress>
</Person>

where compressed_xml_tree_string is the xml tree as a compressed string value

e.g.
compressed_xml_tree_string =
"<Address>
      <Strasse>Wallstreet</Strasse>
      <Hausnr>45</Hausnr>
 </Address>"

The string seems to be written as 
  &lt;Address&gt;
    &lt;Strasse&gt;Wallstreet&lt;/Strasse&gt;
    &lt;Hausnr&gt;45&lt;/Hausnr&gt;
  &lt;/Address&gt;

Is there an elegant way to do this with MatriX for Net without the control characters (&lt; &gt;) which appear in my text string?

Thank you

Martin
Avatar
Alex #2
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
there is XEP-0138: Stream Compression for XMPP and TLS has build in compression. Both compress the XMPP stream very well and agsXMPP and MatriX bot support stream compression.

There is no need to Compress/Decompress data again in your code IMHO.

Alex
Avatar
martinbach #3
Member since Mar 2009 · 60 posts
Group memberships: Members, Premium
Show profile · Link to this post
Hi Alex,
good to know about XEP-0138, thanks.

Can you give me a hint for implementing client-to-client encryption/decryption on field (element) level with the example above?
I'd like to encrypt some data (element values) on field level in the client regardless of the security features of xmpp and decyrpt the encrypted element values on the receiving client.

Thanks,

Martin
Avatar
Alex #4
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hi Martin,

thats not thats easy. Designing an encryption protocol depends on many different factors and requirements. To get some ideas so could look at OTR which is implemented in many IM clients, or RSA and PGP.
There are also some XEPs which define end to end (e2e) in XMPP. Because this is a very complex task the XSF had went in different directions in the past. The current version is XTLS, and I hope this will be the last and final attempt to design e2e for XMPP.

Alex
Avatar
martinbach #5
Member since Mar 2009 · 60 posts
Group memberships: Members, Premium
Show profile · Link to this post
Hi Alex,

I think I should wait for XTLS.

Thanks,
Martin
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS