惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
V
Visual Studio Blog
J
Java Code Geeks
Engineering at Meta
Engineering at Meta
爱范儿
爱范儿
Vercel News
Vercel News
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
W
WeLiveSecurity
B
Blog RSS Feed
P
Privacy International News Feed
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Hacker News
The Hacker News
人人都是产品经理
人人都是产品经理
D
Docker
Blog — PlanetScale
Blog — PlanetScale
C
Cisco Blogs
T
Threatpost
aimingoo的专栏
aimingoo的专栏
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
有赞技术团队
有赞技术团队
L
Lohrmann on Cybersecurity
F
Full Disclosure
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
Stack Overflow Blog
Stack Overflow Blog
月光博客
月光博客
博客园 - 【当耐特】
T
Threat Research - Cisco Blogs
Security Latest
Security Latest
雷峰网
雷峰网
T
Tor Project blog
Cisco Talos Blog
Cisco Talos Blog
Spread Privacy
Spread Privacy
K
Kaspersky official blog
I
Intezer
The Register - Security
The Register - Security
宝玉的分享
宝玉的分享
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
Simon Willison's Weblog
Simon Willison's Weblog
腾讯CDC
U
Unit 42
T
Tenable Blog
IT之家
IT之家
NISL@THU
NISL@THU

博客园 - 新西兰程序员

C++ 构造函数中的初始化参数列表initializer list C++中的线程thread,以及C++11中的std::atomic学习 Leetcode56 Merge Intervals 合并区间 -- C++实现 C++中的内存对齐 C++中的static关键字使用以及全局变量 C++17中的结构化绑定Structured Binding C++中的函数参数是指针类型, 是按值传递 C++中异常处理机制中的栈展开stack unwinding C++实现链表反转 Linux中的性能分析工具 perf 来分析C++性能 C++17中新建一个类时,编译器默认生成的类成员函数 QT中的元对象系统 Leetcode 114 - 二叉树展开为链表 Leetcode65 有效数字 - 判断给定的字符串是否是一个有效数字 LettCode2289-Steps to Make Array Non-descreasing C#中的委托详解 C++中的std::function C++中的仿函数Functor C++中的const和constexpr异同比较 C++中的左值和右值,以及右值引用,移动语义 C++中传递参数是指针类型以及传入参数是指针的指针(**)详解 C++中GetTickCount函数学习 C++中以类的成员函数作为Windows callback函数需要设置成static函数 C++中的悬挂指针和野指针 C++中四种不同的对象生存方式(in stack, in heap, global, local static) C#中使用Parallel类来进行多线程并发编程 String类型转LPCTSTR -----理解C++中的字符串类型转换 C++中的虚函数和虚函数表 C++中基类指针指向派生类对象 数据结构 - 栈的学习
C#中的System.Security.SecureString学习
新西兰程序员 · 2024-05-10 · via 博客园 - 新西兰程序员

有一次在公司review代码时,有一个password的字段,原来用的是String类型,有同事提到应该用SecureString比较好

于是我花了点时间了解了一下什么是SecureString, 以及它与String类型的区别

正常的String类型值,在脱离开作用域后,它的值在内存中并不会立即被销毁. 这个时候,如果有人恶意扫描你的内存,程序中保存的机密信息就有可能会被暴露

而System.Security.SecureString表示一个应该保密的文本,它在初始化时就已经被加密, 并且在脱离作用域后会立即被销毁