Server side encryption works, but data is not readable anymore, not in the app nor the web page

Nextcloud version (eg, 12.0.2): 13.0.0
Operating system and version (eg, Ubuntu 17.04): Ubuntu 16.04.2 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.18
PHP version (eg, 7.1): PHP 7.0.22

The issue you are facing:

I enabled server side encryption. When uploading new data, I can see on the terminal, it gets created and encrypted. If I want to open for example a text file, it cannot be opened, not in the IOS nor in the browser.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. create file by pressing ±button or moving in a file with a mouse
  2. double click on text file in nextcloud browser window or try to open it in the app
  3. error comes up: ‘An error occurred! multikeydecrypt with share key failed:error:0407109F:rsa routines:RSA_padding_check_PKCS1_type_2:pkcs decoding error’ or in the app ‘Datei herunterladen: Der Server ist vorübergehend nicht verfügbar’

The output of your Nextcloud log in Admin > Logging:

routines:RSA_padding_check_PKCS1_type_2:pkcs decoding error
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 85: OCA\DAV\Connector\Sabre\File->get()
[internal function] Sabre\DAV\CorePlugin->httpGet(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method GET', Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php - line 80: Sabre\DAV\Server->exec()
/var/www/nextcloud/remote.php - line 164: require_once('/var/www/nextcl...')
{main}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):


<?php
$CONFIG = array (
  'instanceid' => 'removed',
  'passwordsalt' => 'removed',
  'secret' => 'removed',
  'trusted_domains' =>
  array (
    0 => 'removed',
    1 => 'removed',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'overwrite.cli.url' => 'removed',
  'dbtype' => 'mysql',
  'version' => '13.0.0.14',
  'dbname' => 'removed',
  'dbhost' => 'localhost:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_admin1',
  'dbpassword' => 'removed',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 4,
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'removed',
  'mail_domain' => 'removed',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'removed',
  'mail_smtpport' => '25',
  'mail_smtpname' => 'removed',
  'mail_smtppassword' => 'removed',
  'updater.release.channel' => 'stable',
  'updater.secret' => 'removed',
);