SecureStringNAOT
Compile time string encryption with NativeAOT
Install / Use
/learn @ZeroLP/SecureStringNAOTREADME
SecureStringNAOT
Compile time string encryption with NativeAOT
This example utilises the fact that the static constructors including static readonly fields are pre-interpreted at compile time when the ILC(NativeAOT compiler) translates the code into native code.
Limitation
As the strings are a reference-type that are allocated on the heap, they are ultimately baked statically into the compiled executable. Therefore, only stack allocated Span<char> can be encrypted.
Any solution is welcomed via PR, however I have yet to find a viable solution as the issue tightly relates to how strings work in .NET.
Before Decryption


After Decryption

Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
