Skip to content

Add secure memory #2

@stkptr

Description

@stkptr

libsodium provides utilities for handling "secure" memory, that is, utilities for sanity checking memory and ensuring it's overwritten with random data so that functions within the process are less likely to stumble upon keys.

Secure memory could be implemented, but it's uncertain whether there would be many guarantees on its behavior.

  • Evaluate whether or not secure memory can actually be kept by Godot (References should suffice)
  • Add a subclass of PackedByteArray, SecureBytes/SecureByteArray, which stores all data in libsodium secure memory
  • Add secure memory versions of the GDSodiumType classes
  • Add versions of every API which stores the output in an existing PackedByteArray or subclass

The procedure for using secure memory would then be very similar to using it in libsodium, but with less boilerplate.

var smem = GDSodiumSecureMemory.create(GDSodiumAEAD.CHACHA20_IETF_KEY_SIZE)
GDSodiumAEAD.chacha20_ietf_generate_key_in(smem)
smem.clear()

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions