TAILIEUCHUNG - Beginning PHP and Postgre SQL E-Commerce From Novice to Professional phần 7

Chứa các lớp SecureCard, đại diện cho một thẻ tín dụng. Lớp này có thể được cung cấp với thông tin thẻ tín dụng, sau đó được truy cập trong định dạng mã hóa. Lớp này cũng có thể lấy dữ liệu thẻ tín dụng mã hóa và cung cấp truy cập đến thông tin giải mã. | CHAPTER 11 MANAGING CUSTOMER DETAILS 357 Both these tasks are carried out by business tier classes that you ll save in the business directory in the following files Contains the PasswordHasher class which contains the static method Hash that returns the hash value for the password supplied. Contains the SecureCard class which represents a credit card. This class can be supplied with credit card information which is then accessible in encrypted format. This class can also take encrypted credit card data and supply access to the decrypted information. The class contained in this file SymmetricCrypt is used by SecureCard to encrypt and decrypt data. This means that if you ever want to change the encryption method you only need to modify the code here leaving the SecureCard class untouched. We ll look at the code for hashing first followed by encryption. Implementing Hashing Functionality in the Business Tier Hashing is a means by which you can obtain a unique value that represents an object. The algorithm used to convert the source byte array into a hashed byte array varies. The most used hashing algorithm is called MD5 Message Digest another name for the hash code generated which generates a 128-bit hash value. Unfortunately many kinds of attacks are based on word dictionaries constructed against MD5 hashes. Another popular hashing algorithm is called SHA1 Secure Hash Algorithm which generates a 160-bit hash value. SHA1 is generally agreed to be more secure although slower than MD5. In the HatShop implementation you ll use SHA1 although it is easy to change this if you require another type of security. Now you ll implement the PasswordHasher class in the following exercise. Note PHP doesn t come by default with support for mhash and mcrypt the libraries we re using in this chapter for hashing and encryption. See Appendix A to learn how to enable support for mhash and mcrypt. Exercise Implementing the .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.