In: Computer Science
Explain how you can secure passwords and other sensitive data on a website. Provide code snippets to explain your approach. Your answer can be based on the use of PHP/MySQL or ASP.NET/SQL based solution. Explain how online advertisements will be stored and served.
Solution:
Here are some tips by which you can save your password and other case sensetive data:
1. Encrypt your data :-Data encryption isn't just for technology geeks; modern tools make it possible for anyone to encrypt emails and other information. "Encryption used to be the sole province of geeks and mathematicians, but a lot has changed in recent years. In particular, various publicly available tools have taken the rocket science out of encrypting (and decrypting) email and files. GPG for Mail, for example, is an open source plug-in for the Apple Mail program that makes it easy to encrypt, decrypt, sign and verify emails using the OpenPGP standard. And for protecting files, newer versions of Apple's OS X operating system come with FileVault, a program that encrypts the hard drive of a computer. Those running Microsoft Windows have a similar program. This software will scramble your data, but won't protect you from government authorities demanding your encryption key under the Regulation of Investigatory Powers Act (2000), which is why some aficionados recommend TrueCrypt, a program with some very interesting facilities,
2:Backup your data:-One of the most basic, yet often overlooked, data protection tips is backing up your data. Basically, this creates a duplicate copy of your data so that if a device is lost, stolen, or compromised, you don't also lose your important information.
Code:-
1:Use validations:
if
(filter_var(
$address
,
FILTER_VALIDATE_EMAIL)){
echo
"Email is
valid."
;
}
else
{
echo
"Not valid."
;
}
2:Sanitization:
//Remove all characters from the email except letters,
digits and !#$%&'*+-=?^_`{|}~@.[]
echo
filter_var(
$dirtyAddress
,
FILTER_SANITIZE_EMAIL);
3:Use Escaping:
<?php
//Do some stuff that makes sure it's time to write data to
the browser
?>
Thanks
for
your order. Please
visit us again. You ordered <?php
echo
esc_html(
$productName
);
?>.
Ad Servers:-
Ad servers can be used by publishers (known as first-party ad servers) and advertisers (known as third-party ad servers).
While first-party and third-party ad servers are essentially the same technology, they are used by publishers and advertisers for slightly different reasons
First-Party Ad Servers
First-party ad servers allow publishers to manage ad slots on their websites and display ads that have been sold directly to advertisers via direct campaigns.
In the event that no direct campaigns are available, first-party ad servers will act as a management platform helping to decide which ad codes (e.g. those from a third-party ad server, SSP, or ad network) to serve in their ad slots.
A first-party ad server is responsible for targeting, i.e. making decisions about which ads to display on a website based on nuanced targeting parameters, serving them, and collecting and reporting the data (such as impressions, clicks etc.)
Additionally, they are used for inventory forecasting — i.e. how much inventory and of what type the publisher will have available for sale in the future based on the current campaigns & traffic projections.
Third-Party Ad Servers
By using ad servers, advertisers can easily track their advertising campaigns. An advertiser’s ad server ad tag is loaded by the first-party ad server, so its functionality is limited compared to first-party servers. It is mostly used only to collect campaign data and verify certain metrics, such as impressions and clicks.
Third-party ad servers can also be used for some creative optimizations – e.g. the advertiser can decide to change the creative used in a campaign or run a series of A/B tests of the creative, but the targeting itself is determined on the first-party ad server side.
The primary difference is that a third-party ad server is used by the advertisers to aggregate all the campaign information (reporting, audience) across all publishers, ad networks & other platforms the campaign runs on, and serves as an auditing tool to measure and verify whether the impressions were actually delivered properly. Publishers and advertisers, for various reasons, may report different numbers, but certain degree of discrepancy is considered normal. Third-party ad servers also offer advertisers ownership and control of the collected data (information about the audience).