Wrong private Key

Nextcloud version (eg, 10.0.2): 12.0.4
Operating system and version (eg, Ubuntu 16.04): 16.04.3 LTS
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 5.6): 7.0.22
Is this the first time you’ve seen this error?:
Can you reliably replicate it? (If so, please outline steps):

The issue you are facing:

I would enable encryption on my cloud. But I doesn’t work. I get, every time I enable the default encryption module, a message that the private key is wrong.
On my testcloud I get this message also, but I can fix it with deleting the keys in files_encryption/OC_DEFAULT_MODULE

(at this time no data uploaded to the Cloud and nothing encrypted.)

The output of your Nextcloud log in Admin > Logging:

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

Exception: Can not get secret from Nextcloud instance

    /var/www/vhosts/domain.tld/cloud.domain.tld/apps/encryption/lib/KeyManager.php - line 192: OCA\Encryption\KeyManager->getMasterKeyPassword()
    /var/www/vhosts/domain.tld/cloud.domain.tld/apps/encryption/lib/Users/Setup.php - line 87: OCA\Encryption\KeyManager->validateMasterKey()
    /var/www/vhosts/domain.tld/cloud.domain.tld/apps/encryption/lib/AppInfo/Application.php - line 73: OCA\Encryption\Users\Setup->setupSystem()
    /var/www/vhosts/domain.tld/cloud.domain.tld/apps/encryption/appinfo/app.php - line 30: OCA\Encryption\AppInfo\Application->__construct(Array, true)
    /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/legacy/app.php - line 209: require_once('/var/www/vhosts...')
    /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/legacy/app.php - line 149: OC_App requireAppFile('encryption')
    /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/legacy/app.php - line 124: OC_App loadApp('encryption')
    /var/www/vhosts/larsmueller.net/cloud.larsmueller.net/lib/base.php - line 989: OC_App loadApps()
    /var/www/vhosts/domain.tld/cloud.domain.tld/index.php - line 48: OC handleRequest()

Are you using external storage? If not, please note that the server-side encryption was designed for this use case. And for other threat models, there are better solution. NC 13 was announced to ship client-side encryption which might be interesting for many users (however some serious testing and evaluation will be required before using it in production).

I have one local storage that is mounted as external storage. Okay the encryption is only designed for Encrypt external storages? Good to know.

Okay I will wait for NC 13.