aboutsummaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib/Crypto/Crypt.php
Commit message (Collapse)AuthorAgeFilesLines
* Increase from 100000 to 600000 iterations for hash_pbkdf2Côme Chilliet2023-05-231-9/+9
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Cleanup signature checking logic in encryptionjld31032023-04-141-4/+6
| | | | Signed-off-by: jld3103 <jld3103yt@gmail.com>
* Add a test for multiKeyEncrypt/Decrypt methodsCôme Chilliet2023-03-201-0/+3
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Adapt code to new encryption systemCôme Chilliet2023-03-171-12/+3
| | | | | | | | | fileKey gets deleted upon save as it’s stored in shareKeys instead now. We use presence of a fileKey to detect if a file is using the legacy system or the new one, because we do not always have access to header data. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Getting rid of openssl_seal and rc4 in server side encryptionCôme Chilliet2023-03-171-5/+58
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Set functions as private to be able to refactor laterCôme Chilliet2023-02-211-7/+9
| | | | | | Also a few comment fixes Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Move to phpseclib implementation of RC4Côme Chilliet2023-02-211-42/+16
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Strong type custom openssl_seal implementationCôme Chilliet2023-02-211-28/+12
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Always wrap rc4, and throws on unknown cipherCôme Chilliet2023-02-211-34/+11
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* introduce wrapped_openssl_seal() and wrapped_openssl_open() to circument RC4 ↵Kevin Niehage2023-02-211-2/+164
| | | | | | problems with OpenSSL v3 Signed-off-by: Kevin Niehage <k.niehage@syseleven.de>
* Remove workarounds specific to 7.4Côme Chilliet2023-01-201-4/+3
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix psalm issues related to signature changes from PHP 8.0Côme Chilliet2022-12-291-1/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Replace getSystemValue in encryption appJ0WI2022-12-051-3/+3
| | | | Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* Save encrypted files in binary formatplumbeo2022-05-041-11/+36
| | | | | | | | | | | | | Default to the more space-efficient binary encoding for newly encrypted files instead of the traditional base64 encoding, eliminating the 33% overhead. The new option 'encryption.use_legacy_encoding' allows to force the legacy encoding format if needed. Files encoded in the old format remain readable. Based on https://github.com/owncloud/encryption/pull/224 and https://github.com/owncloud/core/pull/38249 by karakayasemi. Signed-off-by: plumbeo <plumbeo@users.noreply.github.com>
* Fix a few psalm issues and moved back to psalm/phar 4.18Carl Schwan2022-01-121-2/+2
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Remember current cipherJ0WI2021-06-291-4/+23
| | | | Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* Merge pull request #26323 from J0WI/crypt-constblizzz2021-06-231-26/+24
|\ | | | | Use constant for supported formats
| * Use constant for supported formatsJ0WI2021-03-261-26/+24
| | | | | | | | Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* | Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-1/+0
| | | | | | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* | Drop OpenSSL 0.9.8 workaroundJ0WI2021-03-261-7/+0
|/ | | | Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* FIXME use default RC4 methodRoeland Jago Douma2020-12-071-2/+2
| | | | | | * We should pick better default method! Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix encryption testRoeland Jago Douma2020-12-071-1/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* The encryption decrypt position can be int or stringChristoph Wurst2020-10-131-1/+1
| | | | | | | The public API said string, internally we treated it as int. In reality both are used. Let's reflect that in the documented argument type. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update the license headers for Nextcloud 20Christoph Wurst2020-08-241-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Make legacy cipher opt inRoeland Jago Douma2020-08-191-1/+16
| | | | | | | | * Systems that upgrade have this enabled by default * New systems disable it * We'll have to add some wargning in the setup checks if this is enabled Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* SSE enhancementRoeland Jago Douma2020-08-111-2/+8
| | | | | | | Do not blind concatenate ints. Lets add a _ between them. So that we can distrinquis them properly Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Update license headers for 19Christoph Wurst2020-04-291-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add visibility to all constantsChristoph Wurst2020-04-101-5/+5
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-8/+3
| | | | | | | | | | | | | | | To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use elseif instead of else ifChristoph Wurst2020-04-101-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use exactly one empty line after the namespace declarationChristoph Wurst2020-04-091-1/+0
| | | | | | For PSR2 Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2019-12-051-1/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Some php-cs fixesRoeland Jago Douma2019-11-221-1/+0
| | | | | | | | | | | * Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* improve variable namingBjoern Schiessle2018-11-301-4/+4
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* in case 'encryption_skip_signature_check' was set to true we accept if the ↵Bjoern Schiessle2018-11-271-1/+3
| | | | | | file doesn't has a signature Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Allow to disable the signature checkBjoern Schiessle2018-11-271-1/+7
| | | | | | This allows you to recover encryption files even if the signature is broken Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Adding a check to see if keyFileContents is empty:Stefan Weiberg2018-08-211-0/+4
| | | | | | | | | * this fixes a download error and an exception if the data content for encryption is empty * #3958: for recovering encrypted files with a damaged signature this is necessary in addition to turning the signature check off Signed-off-by: Stefan Weiberg <sweiberg@suse.com>
* Simplify return statementMorris Jobke2018-02-131-5/+2
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Use stripos instead of strpos(strtolower(), 'something')Morris Jobke2018-01-251-1/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Update license headersMorris Jobke2017-11-061-0/+2
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Fix comparisons in encryption appJoas Schilling2017-08-011-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Update comments to NextcloudMorris Jobke2017-04-111-3/+3
| | | | | | | * based on PR by @Ardinis * see #4311 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* always throw a encryption exceptionBjoern Schiessle2017-03-141-5/+4
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Fix apps/Joas Schilling2016-07-211-2/+3
|
* Update license headersLukas Reschke2016-05-261-2/+2
|
* Move Encryption app to PSR-4 (#24524)Joas Schilling2016-05-121-0/+693
* Move Encryption to PSR-4 * Move encryption tests to PSR-4 * Fix the tests