In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Download the latest version of UniDAC
Universal Data Access Components (UniDAC) is a general database access component that provides direct access to multiple databases, such as Delphi, C++Builder, Lazarus (and Free Pascal), Mac OS X, iOS, Android, Linux and 64 and 32-bit FreeBSD for Windows. We will focus our long-term experience on this widget to provide unified database connection access (such as oracle, Microsoft SQL, etc.). This means that you can easily switch different databases between your projects and create cross-database application interfaces.
UniDAC has built-in data encryption and decryption algorithms. To enable encryption, attach the TCREncryptor component to the dataset and specify the encryption field. When you insert or update data in a table, the information is encrypted on the client side as specified. Similarly, when reading data from the server, the component decrypts the data in these fields "immediately".
For encryption, you should specify the data encryption algorithm (EncryptionAlgorithm attribute) and password (Password attribute). Generates a key based on the specified password and encrypts the data. You can also use the SetKey method to set the key directly.
When storing encrypted data, you can store other information in addition to the initial data: GUID and hash. Method is specified in the TCREncryptor.DataHeader property.
If the data is stored without additional information, it is not possible to determine whether the data is encrypted. In this case, only the encrypted data should be stored in the column, otherwise confusion will occur because it is impossible to distinguish the nature of the data. Similarly, from the perspective of information protection, similar source data will be equivalent in the form of encryption, which is not good. The advantage of this method is that the size of the initial data is equal to that of the encrypted data.
To avoid these problems, it is recommended that you store the appropriate GUID with the data, which is necessary to specify that the values in the record are encrypted and that the data must be decrypted when it is read. This allows you to avoid confusion and save encrypted and decrypted data in the same column, which is especially important when working with existing tables. Similarly, when doing so, a random initialization vector is generated for encryption before the data is encrypted. This allows you to receive different results from the same initial data, which significantly improves security.
The most desirable approach is to store hash data as well as GUID and encrypted information to determine the validity of the data and verify its integrity. In this way, if you try to forge data at any stage of transmission or data storage, a corresponding error will occur when decrypting the data. To calculate the hash, you can use the SHA1 or MD5 algorithm (the HashAlgorithm attribute).
The disadvantage of the latter two methods is that additional memory is needed to store auxiliary information.
Because the encryption algorithm uses a buffer of a certain size and requires additional memory to store additional information, TCREncryptor only supports encryption of string or binary fields (ftString, ftWideString, ftBytes, ftvarBytes, ftBlob, ftMemo, ftWideMemo). If you use string field encryption, first encrypt the data, and then convert the resulting binary data to hexadecimal format. In this case, the data store requires twice as much space (one byte = 2 hexadecimal characters).
Therefore, in order to be able to encrypt other data types (such as dates, numbers, and so on), you need to create fields of binary or blob type in the table, and then convert them to the desired type on the client side with the help of data mapping.
It is important to note that it is not possible to search and sort through encrypted fields on the server side. Data searches for these fields can be performed on the client only after the data has been decrypted using the Locate and LocaTex methods. Sorting is performed by setting the TMemDataSet.IndexFieldNames property.
For example:
For example, a table stores a list of employees for an enterprise that contains the following data: full name, date of employment, salary, and photo. We want all this data to be stored in encrypted form. Write a script to create the table:
one
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.