Maximum Secure Note size that the CLI can create

HippoMan
HippoMan
Community Member

I'm trying to find out the largest size of a Secure Note that the CLI can create. Is it 5 Meg?

Even if it is, since the CLI-based creation process requires the JSON wrapper of the Secure Note to be base64-encoded, and since this increases the size by a factor of 4/3, and since there are limits to the size of a shell command line, it seems unlikely to me that the CLI could manage a Secure Note of this size.

I have been trying to find documentation for the maximum length of a Secure Note, but I haven't been able to locate it. Please forgive me if I overlooked it.


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Sync Type: Not Provided

Comments

  • Good question, and you didn't miss the documentation for it. I don't think it's publicly documented anywhere.

    The whole of the encrypted payload of an item needs to be under 4MB. Since we're using a block cipher there's no real difference between the encrypted size and the decrypted size. So that means that what you pass to op encode should be under 4MB. Since there's a bit of overhead with the JSON involved with what you pass to op encode you'll need to take that into consideration as well.

    Rick

  • HippoMan
    HippoMan
    Community Member

    Thank you. And I'm also thankful that the maximum size is 4 MB, which is more than sufficient for my needs.

  • AGAlumB
    AGAlumB
    1Password Alumni

    Glad Rick was able to help! Have a great weekend! :)

  • jpgoldberg
    jpgoldberg
    1Password Alumni

    Since we're using a block cipher there's no real difference between the encrypted size and the decrypted size.

    Well no difference that matters; but with GCM the initialization vector adds 16 bytes, padding will add between 1 and 16 bytes, and the authentication tag adds 12 bytes. So allow for the ciphertext to be up to 44 bytes longer than the plaintext.

  • HippoMan
    HippoMan
    Community Member
    edited May 2018

    OK, thank you. For my purposes, the extra 44-byte length is insignificant. However, this is still good to know.

  • What's 44 bytes between friends? :)

    Rick

  • HippoMan
    HippoMan
    Community Member
    edited May 2018

    Yep! And my only regret is that it's not 42 bytes. That number is the answer to the question of the meaning of Life, the Universe, and Everything.

  • Don't forget your towel.

    Rick

This discussion has been closed.