<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Binary Encryption Issue in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327525#M14526</link>
    <description>&lt;P&gt;You have to take in mind that, with the code above, you are saying that only documents with the property "dc&lt;/P&gt;</description>
    <pubDate>Wed, 29 Apr 2020 17:12:31 GMT</pubDate>
    <dc:creator>Rodri_</dc:creator>
    <dc:date>2020-04-29T17:12:31Z</dc:date>
    <item>
      <title>Binary Encryption Issue</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327521#M14522</link>
      <description>&lt;P&gt;I have added below lines in nuxeo.conf
nuxeo.core.binarymanager=org.nuxeo.ecm.core.blob.binary.AESBinaryManager
nuxeo.core.binarymanager_key=password=mypassword&lt;/P&gt;
&lt;P&gt;I was already having some files already available in binaries folder which were in plain format (not encrypted).
So i tried to create document with encryption then i am getting &lt;STRONG&gt;Invalid Type (Bad Magic)&lt;/STRONG&gt; exception . it is because the MD5 which is getting generated with encryption technique is already available in plain format (with out encryption) in binary folder.&lt;/P&gt;
&lt;H2&gt;and it is giving issue in below line:-
**protected void decrypt(InputStream in, OutputStream out) throws IOException {
byte[] magic = new byte[FILE_MAGIC.length];
IOUtils.read(in, magic);
if (!Arrays.equals(magic, FILE_MAGIC)) {
throw new IOException("Invalid file (bad magic)");
}
**
Resolution on my end:-&lt;/H2&gt;
&lt;P&gt;I have deleted content of binary/data folder and deleted the folder structure from webUi ex: XXX/workspaces/YYY
and created doc with encryption it is working fine.&lt;/P&gt;
&lt;H2&gt;PROBLEM:&lt;/H2&gt;
&lt;P&gt;So I want to know is there any possibility that we can bring AESEncryption on demand . so it will not hamper already generated file in plain format.
If i want to remove encryption i can remove it.
and is there any possibility i can apply encryption on tenant specific.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 05:51:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327521#M14522</guid>
      <dc:creator>Rahul_Mittal</dc:creator>
      <dc:date>2020-04-24T05:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Encryption Issue</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327522#M14523</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;adding the two lines to nuxeo.conf is the generic way to implement binary encryption, but it is the least flexible, since encryption is applied to all binaries without exception. This causes problems if there are already "plain" binaries, or if you don't want to encrypt all future binaries.&lt;/P&gt;
&lt;P&gt;In this case, you will need to define BlobDispatchers and BlobProviders. I recommend you to read the following: &lt;A href="https://doc.nuxeo.com/nxdoc/file-storage/"&gt;https://doc.nuxeo.com/nxdoc/file-storage/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;When you do something with a document (like creating it or download it), the BlobManager will decide what to do. The BlobManager will evaluate the conditions over all the BlobDispatchers, and it will select the desired BlobProvider. For example, you can use a custom property to encrypt binaries:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;extension target="org.nuxeo.ecm.core.blob.DocumentBlobManager" point="configuration"&amp;gt;
	&amp;lt;blobdispatcher&amp;gt;
		&amp;lt;class&amp;gt;org.nuxeo.ecm.core.blob.DefaultBlobDispatcher&amp;lt;/class&amp;gt;
		&amp;lt;property name="custom:encrypted=true"&amp;gt;encrypted&amp;lt;/property&amp;gt;
		&amp;lt;property name="default"&amp;gt;default&amp;lt;/property&amp;gt;
	&amp;lt;/blobdispatcher&amp;gt;
&amp;lt;/extension&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the "name" inside the "property" tag you put the condition that must be true in order to use that BlobProvider. Remember not to forget the "default" BlobDispatcher pointing to the "default" BlobProvider! And then just define the BlobProvider:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;extension target="org.nuxeo.ecm.core.blob.BlobManager" point="configuration"&amp;gt;
	&amp;lt;blobprovider name="encrypted"&amp;gt;
		&amp;lt;class&amp;gt;org.nuxeo.ecm.core.blob.binary.AESBinaryManager&amp;lt;/class&amp;gt;
		&amp;lt;property name="key"&amp;gt;password=secret&amp;lt;/property&amp;gt;
	&amp;lt;/blobprovider&amp;gt;
&amp;lt;/extension&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I hope it helps!&lt;/P&gt;
&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 06:38:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327522#M14523</guid>
      <dc:creator>Rodri_</dc:creator>
      <dc:date>2020-04-28T06:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Encryption Issue</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327523#M14524</link>
      <description>&lt;P&gt;[Rodri ](https&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 12:14:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327523#M14524</guid>
      <dc:creator>Ankush_Bandil</dc:creator>
      <dc:date>2020-04-29T12:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Encryption Issue</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327524#M14525</link>
      <description>&lt;P&gt;[Rodri ](https&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 14:28:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327524#M14525</guid>
      <dc:creator>Ankush_Bandil</dc:creator>
      <dc:date>2020-04-29T14:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Encryption Issue</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327525#M14526</link>
      <description>&lt;P&gt;You have to take in mind that, with the code above, you are saying that only documents with the property "dc&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 17:12:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327525#M14526</guid>
      <dc:creator>Rodri_</dc:creator>
      <dc:date>2020-04-29T17:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Encryption Issue</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327526#M14527</link>
      <description>&lt;P&gt;Hi Rodri ,&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 05:53:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327526#M14527</guid>
      <dc:creator>Rahul_Mittal</dc:creator>
      <dc:date>2020-04-30T05:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Encryption Issue</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327527#M14528</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 06:33:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327527#M14528</guid>
      <dc:creator>Rodri_</dc:creator>
      <dc:date>2020-04-30T06:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Encryption Issue</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327528#M14529</link>
      <description>&lt;P&gt;Hi Rodri,&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 18:11:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327528#M14529</guid>
      <dc:creator>Rahul_Mittal</dc:creator>
      <dc:date>2020-04-30T18:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Encryption Issue</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327529#M14530</link>
      <description>&lt;P&gt;Hi [Rodri ](https&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 13:51:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327529#M14530</guid>
      <dc:creator>Ankush_Bandil</dc:creator>
      <dc:date>2020-05-06T13:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Encryption Issue</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327530#M14531</link>
      <description>&lt;P&gt;It seems there's a confusion in these comments about Repository vs Blob Provider. A Repository is the toplevel entity in which documents (and their metadata) are stored. A Blob Provider is an entity that knows how to store and retrieve blobs. By default there is one Blob Provider per Repository, but using a Blob Dispatcher you can associate rules to a Repository to dispatch blobs to one of several Blob Providers. See https&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 17:08:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/binary-encryption-issue/m-p/327530#M14531</guid>
      <dc:creator>Florent_Guillau</dc:creator>
      <dc:date>2020-05-06T17:08:18Z</dc:date>
    </item>
  </channel>
</rss>

