Is memory encrypted?

前端 未结 6 1258
长发绾君心
长发绾君心 2021-02-05 03:15

I want to store some data in a variable (and I know variables are stored in memory). Does that data in memory get encrypted? Also, is it possible for software to be able to read

6条回答
  •  情歌与酒
    2021-02-05 04:07

    Does that data in memory get encrypted?

    Usually no. I say "usually" only because you could conceivably make an operating system or hardware that does encrypt memory. So really, no.

    Is it possible for software to be able to read the variable names stored in memory and be able to actually extract the data from it?

    Depends. With code in an interpreted language like PHP variable names are kept in memory somewhere, so conceivably it's possible. With compiled code like (like C++), it could be compiled with debug information (and then a debugger would be able to see variable names and extract their values), or it could be compiled without it and then the variable names are lost.

    Also, it's very easy to write a program that reads arbitrary memory addresses, but it's much harder to figure out what the bytes you read mean.

提交回复
热议问题