All Projects → marnix → synology-decrypt

marnix / synology-decrypt

Licence: GPL-3.0 license
An open source implementation/description of the Synology Cloud Sync encryption/decryption algorithm

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to synology-decrypt

synology-api
A Python wrapper around Synology API
Stars: ✭ 116 (+27.47%)
Mutual labels:  synology, synology-nas
AirConnect-Synology
Updated AirConnect packages for Synology NAS and Synology Router
Stars: ✭ 200 (+119.78%)
Mutual labels:  synology, synology-nas
synology-update-plex
Script to Auto Update Plex Media Server on Synology NAS
Stars: ✭ 89 (-2.2%)
Mutual labels:  synology, synology-nas
cloudflareddns
DDNS with Cloudflare
Stars: ✭ 33 (-63.74%)
Mutual labels:  synology, synology-nas
hpool-miner
chia chia-miner hpool hpool-miner hpool-og-miner hpool-pp-miner Synology RaspberryPi
Stars: ✭ 22 (-75.82%)
Mutual labels:  synology, synology-nas
ciphr
CLI crypto swiss-army knife for performing and composing encoding, decoding, encryption, decryption, hashing, and other various cryptographic operations on streams of data from the command line; mostly intended for ad hoc, infosec-related uses.
Stars: ✭ 100 (+9.89%)
Mutual labels:  decryption
Computer-Security-algorithms
👨‍💻 Computer Security algorithms in C#
Stars: ✭ 48 (-47.25%)
Mutual labels:  decryption-algorithm
Pyload
The free and open-source Download Manager written in pure Python
Stars: ✭ 2,393 (+2529.67%)
Mutual labels:  synology
Photostation Upload Lr Plugin
Photo StatLr (aka PhotoStation Upload) is a Lightroom Publish and Export Service Plugin that enables the export /publishing of photos and videos from Lr to a Synology Photo Station. It uploads the photos/videos and all required thumbnails. It can download comments and ratings and do a real two-way synch of various metadata (tags, ratings, labels).
Stars: ✭ 159 (+74.73%)
Mutual labels:  synology
Synology-NAS-monitoring
influxDB, Grafana, snmp and telegraf
Stars: ✭ 140 (+53.85%)
Mutual labels:  synology
frodo
practical quantum-secure key encapsulation from generic lattices
Stars: ✭ 17 (-81.32%)
Mutual labels:  decryption
Home-Assistant Config
BeardedTinker Home Assistant configuration. Feel free to browse, edit, tweak, improve, criticize and suggest.
Stars: ✭ 241 (+164.84%)
Mutual labels:  synology
client-encryption-nodejs
Library for Mastercard API compliant payload encryption/decryption.
Stars: ✭ 20 (-78.02%)
Mutual labels:  decryption
Synologycloudflareddns
📜 Cloudflare DDNS script for Synology
Stars: ✭ 222 (+143.96%)
Mutual labels:  synology
flickr-uploader
Upload a directory of media to Flickr to use as a backup to your local storage
Stars: ✭ 38 (-58.24%)
Mutual labels:  synology
Openhab Syno Spk
openHAB Synology SPK Install Package
Stars: ✭ 160 (+75.82%)
Mutual labels:  synology
TrezorSymmetricFileEncryption
🔒 Use your Trezor device to symmetrically encrypt and decrypt files
Stars: ✭ 16 (-82.42%)
Mutual labels:  decryption
strong-cryptor
Strong encryption and decryption node js
Stars: ✭ 18 (-80.22%)
Mutual labels:  decryption
qb-rss-manager
qBittorrent rss订阅规则管理, 支持Docker环境, 群晖, Windows桌面, Linux桌面的qb. 推荐直接使用懒人包体验完整功能.
Stars: ✭ 134 (+47.25%)
Mutual labels:  synology
php jwsign
This is a function wrapping through the Openssl to sign and validate the data, which ensures the integrity and security of the original data.
Stars: ✭ 33 (-63.74%)
Mutual labels:  decryption

synology-decrypt

Goal

An open source implementation/description of the encryption/decryption algorithm used by Synology NAS products in their Cloud Sync feature, where one can sync data on the NAS to the likes of Google Drive.

Synology publishes a closed source tool (see below), but I would like to be know how to decrypt my own data with my own password or private key, in the (unlikely) event that I lose access to both a NAS of this type and the closed source tool.

Also, I would like to be able to judge the strength of the encryption.

Official documentation of the encryption algorithm exists, but only on a high level, and the file format is not documented at all.

I've chosen Python, since I think that allows to to express the algorithm most clearly.

(Please note that I explicitly do not want to reverse engineer the closed source 'Synology Cloud Sync Decryption Tool', since I want to avoid doing things that might be construed to be illegal.)

How to install and run

You need to download the source code and install a few dependencies:

  • git clone this repository.
  • Make sure you have Python installed (3.2 or later, or 2.7); Linux works, I've never tried it on Windows but that should also Just Work(tm).
  • Install all Python packages which are mentioned in requirements.txt, e.g. by running pip install -r requirements.txt.
  • Make sure you have the lz4 binary on your PATH.
    • On Ubuntu (at least 18.04) you can install it by running apt install liblz4-tool as root.

This is a command line tool, and running it comes down to the following.

  • In the root folder of the cloned repository, run python -m syndecrypt followed by the supported command line arguments (leave out or add -h for usage information / help).

Note that currently this tool does not traverse directories: You either mention all files explicitly on a single command line, either you run it repeatedly.

Feedback

Feel very free to create a GitHub issue, create a pull request, or drop me a line, if you have any opinions, bug reports, requests, or whatever about this project. Thanks!

Build Status

Travis CI says: Build Status

Codacy says: Codacy Badge

License

The code in this repository is licensed under the GPLv3; see LICENSE.txt for details.

Information Sources

There are four pieces of information from Synology, unfortunately spread out over multiple places which are not easy to find, and not linked together at all:

  • 'Synology Cloud Sync Decryption Tool', the closed source decryption tool (Windows and Linux only, apparently GUI only) which Synology provides.

    It can be obtained through the Synology Support Download Center at https://www.synology.com/en-us/support/download/, then choose a NAS that offers Cloud Sync (many of them, e.g., DS110j).

    As of this writing the current version is 009.

    (The GUI has a help icon that opens https://help.synology.com/enu/utility/SynologyCloudSyncDecryptionTool which which contains the same infor as the KB article below. It also returns 404 fairly often.)

  • Synology Knowledge Base article "What is Synology Cloud Sync Decryption Tool?" describing how to use the above decryption tool.

  • Page 9 of "Cloud Sync White Paper -- Based on DSM 6.0" (archive.org copy) which I received through Synology Support.

  • The Synology NAS software just lets me check an 'encrypt' checkbox and asks for a password, and then sends back a zip-file key.zip with files public.pem and private.pem, without any explanation what I can/should do with it.

    The above documents make it clear that the files are encrypted individually, and that each file can be decrypted using only the password or only private.pem.

Until now, there is only one unofficial source of information:

To Do

The current code is still basic and does not provide enough explanation yet. I'd still like to do the following:

Core decryption algorithm

  • Investigate what key2_hash is a hash of.
  • Warn for any known field that is missing, and for every unknown field.
  • Rename core to algorithm?
  • Full documentation of the algorithm in the 'core' module.
  • Add algorithm diagram.
  • Support encrypt = 0 and compress = 0 modes. (It is an error if either of these fields is not specified.)
  • Add verification of @SynologyCloudSync/cloudsync_encrypt.info file using password and/or private key.
  • Investigate how DSM GUI handles non-ASCII passwords.

Command-line decryption tool

  • Decrypt directories recursively.
  • Check password file: check single line, warning if not printable ASCII.
  • Make log level configurable (default: warning).
  • Add --verify option, to check decryptability and file structure.
  • Make --verify option also verify @SynologyCloudSync/cloudsync_encrypt.info files.

Encryption

  • Add encryption option/algorithm.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].