# Crypt backend, and path lengths

**URL:** <https://forum.rclone.org/t/crypt-backend-and-path-lengths/17188>\
**Category:** Help and Support\
**Created:** [June 14, 2020, 10:48pm UTC](https://forum.rclone.org/t/crypt-backend-and-path-lengths/17188 "2020-06-14T22:48:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bandwidth](https://forum.rclone.org/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@bandwidth](https://forum.rclone.org/u/bandwidth)\
**Post date:** [June 14, 2020, 10:48pm UTC](https://forum.rclone.org/t/crypt-backend-and-path-lengths/17188/1 "2020-06-14T22:48:00Z")

</div>

This is not a question but an FYI for those using the crypt backend.

For cloud vendors like Onedrive that have a limit on the maximum _path_ length (not filename), when using the crypt backend, keep in mind these two:

1. each _segment_ of the path needs to be encrypted separately (for obvious reasons)
2. From: [https://rclone.org/crypt/](https://rclone.org/crypt/) _"File segments are padded using PKCS#7 to a multiple of 16 bytes before encryption."_

This means that if your pathname includes a lot of components that close to a multiple of 16, but greater than it, your encrypted pathname will be way longer than that unencrypted pathname. 1-char, 17-char, 33-char etc. are the worst case scenario. Eg:

```auto
$ rclone backend encode crypted: "/a/b/c/d/e/f/g/h" | wc -c
217
$ rclone backend encode crytped: "/abcdefgh" | wc -c
28
$ rclone backend encode crypted: "/aaaaaaaaaaaaaaa/bbbbbbbbbbbbbbb/cccccccc/dddddddd/e/f/g/h" | wc -c
217

```

This all makes perfect sense. Just pointing it out to save others the trouble of tripping up on it.

See [Max path length for Onedrive + crypt](https://forum.rclone.org/t/max-path-length-for-onedrive-crypt/17011) for more info.

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [August 14, 2020, 6:48pm UTC](https://forum.rclone.org/t/crypt-backend-and-path-lengths/17188/2 "2020-08-14T18:48:00Z")

</div>

Closed on August 14, 2020, 6:48pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
