Commit Graph
173 Commits
Author SHA1 Message Date
Kenneth Skovhede 73a3e627c1 AESCrypt default v2
This PR sets the default AESCrypt stream format to v2.

This is done to introduce the ability to read the v3 format before switching to the new format. With a delayed activation, it is more likely that users can easily roll back a version if needed.
2026-05-04 16:19:56 +02:00
Kenneth SkovhedeandGitHub 49243eeaa8 Merge branch 'master' into features/upgrade-aescrypt-v3 2026-04-17 12:34:49 +02:00
Kenneth Skovhede c0f40e19ca Updated copyright year to 2026 across the project 2026-04-16 15:21:24 +02:00
Kenneth Skovhede e98c48e078 Update SharpAESCrypt to v3
This PR updates SharpAESCrypt to version 3.0.0.

With this change the written format for encrypted fields in the database and the remote encrypted files will be changed to Stream Format v3, which improves the key deriviation function and includes additional safeguards regarding content length.

The library still supports reading v2 files, but will write all new files as v3.

Environment variables, as well as module options, can toggle this behavior.

# Environment variable overview
- `DUPLICATI__AES_VERSION`: The file format version, either 3 (default) or 2
-`DUPLICATI__AES_V3_ITERATIONS`: The number of Pbkdf iterations to apply (default 300k)
- `DUPLICATI__AES_MINIMAL_HEADER`: Writes AES files with a minimal header (saves ~100 bytes per file)
- `DUPLICATI__AES_IGNORE_PADDING_BYTES`: Legacy setting for reading files written by the mainline AESCrypt tool

# A note on iterations
The iterations protect a weak key by adding additional computational overhead, but only adds overhead if the key is already providing at least 256 bits of high entropy.

For low-power devices, such as 32-bit RPI, this can be set as low as 10k, which will lower encryption and decryption time.  Beware that setting a low iteration count reduces security if the key is not sufficiently strong.
2026-03-13 17:20:33 +01:00
Kenneth Skovhede 2faace5e0f Removed unused code 2026-03-02 12:57:29 +01:00
Kenneth Skovhede e009a0f3ec Remote source masking and encrypting
This PR adds masking to remote sources so the passwords are not leaked to the browser. The logic works the same as for TargetURL, where the sensitive fields are replaced by a password placeholder before being transmitted via the endpoints.

When data returns, the masking is removed by looking at the original source and the unmasked value is then encrypted before being stored in the database.

Since the sources is an array and not just a single field, the logic here uses the mount point as a "key" for figuring out which new sources map to the original sources. This is robust in the face of re-ordering, deletions and additions.

If there is just a single remote source (assumed most common) this will match even if the prefix does not, making it possible to change the prefix in this case.

For multi-remote sources, it is not possible to change the prefix without also re-typing all masked properties.

If there is a need later, we could extend the matching to look for how many unique protocols are there, and maybe servers as well to try to match better when the prefixes have been renamed.

There is a guard right before saving a source that rejects it if the source contains the placeholder so we ensure that even faulty logic cannot persist an invalid connection string.
2026-01-30 14:36:57 +01:00
Kenneth Skovhede 1ea74a3c63 Updated to .NET10 2025-11-14 15:05:39 +01:00
Carl Johnsen 04153d2c12 Removed Microsoft.DotNet.Analyzers.Compatibility from csproj's as it's deprecated. 2025-05-16 09:53:26 +02:00
Kenneth SkovhedeandGitHub 997891525a Updated license-updater to update csproj files (#5898)
* Updated license-updater to update csproj files

* License updates
2025-01-22 21:04:19 +01:00
Kenneth SkovhedeandGitHub 9464caf622 Feature/update license 2025 (#5851)
* Fixed some minor whitespace issues

* Updated all copyright to 2025
2025-01-07 09:40:39 +01:00
Kenneth Skovhede a3d46c3951 No need for the GPG path to be information 2024-11-14 15:28:07 +01:00
Kenneth Skovhede 4b84135622 Merge remote-tracking branch 'origin/master' into feature/add-secret-provider 2024-10-24 16:11:41 +02:00
Kenneth Skovhede 34d13a20e2 Initial version of the external secret provider 2024-10-24 16:06:59 +02:00
Carl Johnsen 1fa4d55a2c Bumped the version of SharpAESCrypt 2024-10-24 14:08:26 +02:00
Kenneth Skovhede 025dc5aa1e Fixed tests 2024-09-01 10:48:47 +02:00
Kenneth Skovhede d8c8ce7988 Removed the use of DeviceId due to lack of sufficient key material.
Kept the infrastructure to allow re-introducing it later if a better source for a device key is found.
Added support for not having any valid settings encryption key.
Added warnings if the user is running without a settings encryption key.
Added additional checks during startup to help with troubleshooting and configuring a setup with a settings encryption key.
Docker builds will now warn if no encryption key is set.
This fixes #5518
2024-08-31 11:02:14 +02:00
Kenneth Skovhede 7d5ed6deb7 Added support for blacklisting keys.
Blacklisted keys can only be used for decryption.
2024-08-30 12:43:21 +02:00
Kenneth Skovhede 5af5b4d553 Added option to prevent starting with the machine serial.
This could be part of the solution to #5496
2024-08-28 22:25:23 +02:00
Kenneth Skovhede efd30a06bf Fixed tests by allowing test code to pass a custom key for encryption 2024-08-21 21:02:42 +02:00
Kenneth Skovhede 3c1a4b5d94 Encryption uses StringBuilder instead of stream to minimize byte[] use. 2024-08-20 21:09:14 +02:00
Kenneth Skovhede 7b66271ad4 Enabled minimal header 2024-08-20 21:08:36 +02:00
Kenneth Skovhede 12d196194b Optimizations to avoid repeated calculations on the same data (DeviceId + KeyHash) 2024-08-20 17:01:21 +02:00
Kenneth Skovhede 5dd937bcc2 Updated AES Crypt to support creating encrypted blob with a smaller header. 2024-08-20 16:52:26 +02:00
Marcelo Ceccon 89ca5fb1b5 Adding library level functionality to encrypt settings
This commit only adds the functionality to the library to encrypt settings fields in the sqlite database.

Unit Tests are included in this commit.
2024-08-19 13:50:09 -03:00
Suguru Hirahara 0a9425b944 Remove remaining conjugation 2024-08-13 10:16:20 -04:00
Suguru Hirahara 7e97764387 Use the common expression for AessetthreadlevelDeprecated 2024-08-05 04:23:54 -04:00
Kenneth SkovhedeandGitHub 3b3eb81658 Merge pull request #5351 from duplicati/feature/bump-sharpaescrypt-version
Updated version of SharpAESCrypt
2024-07-30 08:10:37 +02:00
Kenneth Skovhede 1e9970858f Updated version of SharpAESCrypt 2024-07-30 07:39:14 +02:00
Suguru Hirahara c24d235eeb Add periods to strings on Encryption/Strings.cs 2024-07-29 23:26:11 -04:00
Suguru Hirahara 1a3c0ef495 Set strings for options in a consistent way 2024-07-29 11:31:31 -04:00
Suguru Hirahara 8e85c10754 Set arguments for strings 2024-07-29 11:30:43 -04:00
Grzegorz Łagocki 9b19bac7da Add Copyright Property to *.csproj files 2024-07-09 00:37:18 +02:00
Kenneth SkovhedeandGitHub 002a47bd1e Merge pull request #5219 from duplicati/feature/update-sharp-aes-crypt
Updated to SharpAESCrypt 2.0
2024-06-27 09:00:25 +02:00
Kenneth Skovhede 95cb6b4e71 Updated to SharpAESCrypt 2.0 2024-06-04 17:27:18 +02:00
Kenneth Skovhede 7dab2f5935 Removed bundled GPG binaries for Windows.
Improved search logic for finding GPG executable on all operating systems.
This also removes the `win-tools` folder.
2024-06-04 15:21:22 +02:00
Jojo-1000 930f1c8bd3 Fix most unsupported platform warnings. 2024-05-30 01:50:02 +02:00
Kenneth Skovhede 8e25c6e2ab Reduced dynamic scanning with static linking.
Cleaned up some `proj` files.
Added caching to options.
2024-04-26 14:32:41 +02:00
Kenneth Skovhede 473c6cbbb8 Merge commit '4f577c65a4d8806f79637c50c21ca3a683c5a07a' into feature/kestrel-avalonia-upgrade 2024-03-04 12:21:53 +01:00
Kenneth Skovhede aa20088c39 Tool based upgrade of all projects with some manual update 2024-03-01 14:29:54 +01:00
Kenneth Skovhede 35cc847df7 Merge branch 'master' into feature/upgrade-to-sdk-style-projects 2024-03-01 14:28:55 +01:00
Kenneth Skovhede 40dd3c6816 Updated all license mentions to MIT 2024-02-28 15:45:30 +01:00
Kenneth Skovhede 3bf6b162ca Upgraded utility projects.
Removed redundant packages files.
Removed `mozroots` in prepare of switch to non-mono releases.
2024-02-26 08:24:48 +01:00
Kenneth Skovhede d7b6dd90be Updated all projects to use SDK-style projects using upgrade-assist 2024-02-25 16:19:25 +01:00
Thomas Suckow 8c518f7d3a .net6 2022-04-12 21:43:50 -07:00
Kenneth Skovhede b550e61d9b Re-added compatibility analyzers 2021-04-03 21:49:51 +02:00
Kenneth Skovhede 557415c9ad Changed implementation to target netstandard2.0.
Added builds for .Net 4.8
2021-04-03 14:13:32 +02:00
Kenneth Skovhede 8892ff7df3 Cleaned up all .csproj files.
Moved things around to make cleaner build files.
Implementing everything with `netstandard2.1` and then thin wrapper executables using .net5
2021-04-03 13:57:02 +02:00
Kenneth Skovhede 63d8ab7c11 Changed all non-entry methods to use netstandard2.1 2021-04-01 22:37:26 +02:00
Kenneth Hsu e964072690 Target .NET Framework 4.7.1.
This updates all projects to target .NET Framework 4.7.1.  The
TencentCOS and Tardigrade backends depend on .NET Standard 2.0.  When a
.NET Framework prior to 4.7.1 is targeted, the system cannot be sure
that all the dependencies exist, so it copies all dependent assemblies
to the output directory.  This causes many assemblies from the System
namespace to become bundled in the release.

https://stackoverflow.com/a/48875007

We had previously attempted to make individual projects target 4.7.1
(see pull request #4242), but this can cause compatibility issues when
4.6.2 projects depend on 4.7.1. projects.

This will require Mono 5.10.0 or greater (previously, we required 5.0.0
or greater).

https://www.mono-project.com/docs/about-mono/releases/5.10.0/#class-libraries

This fixes issue #4234.
2020-07-26 19:46:01 -07:00
Max b008aed1f3 migrate to net5 + runnable 2020-06-03 00:00:38 +02:00