Недавно наткнулся на интересный Java скрипт – проверка качества ( степени защищенности ) пароля. Т.е. имеем мы к примеру какую либо систему регистрации пользователей в которой пользователь пишет свой пароль и по мере ввода символов система сообщает ему насколько качественный его пароль.
Рецепт хорошего пароля: 1 Длинна пароля должна быть 8 и более символов. 2 Используйте буквы как нижнего так и верхнего регистра. 3 Используйте более чем одну цифру 5 Используйте спецсимволы (!,@,#,$,%,^,&,*,?,_,~). 6 Используйте Leet
Данный скрипт работает по принципу оценки пароля по 100 бальной шкале, присваивая в зависимости от используемых символов определенное количество баллов.
>= 0 баллов : очень слабый
>= 25 баллов: слабый
>= 50 баллов: нормальный
>= 60 баллов: достаточно неплохо
>= 70 баллов: хороший
>= 80 баллов: очень хороший
>= 90 баллов: отличный пароль! Главное не забыть его :)
Итак сам процесс установки данного скрипта ( он достаточно прост и делается буквально за 5 минут )
Сам скрипт, который мы сохраним в файле к примеру pwd_strength.js
// Settings
// -- Toggle to true or false, if you want to change what is checked in the password
var m_strUpperCase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var m_strLowerCase = "abcdefghijklmnopqrstuvwxyz";
var m_strNumber = "0123456789";
var m_strCharacters = "!@#$%^&*?_~"
// Check password
function checkPassword(strPassword)
{
// Reset combination count
var nScore = 0;
// Password length
// -- Less than 4 characters
if (strPassword.length < 5)
{
nScore += 5;
}
// -- 5 to 7 characters
else if (strPassword.length > 4 && strPassword.length < 8)
{
nScore += 10;
}
// -- 8 or more
else if (strPassword.length > 7)
{
nScore += 25;
}
// Letters
var nUpperCount = countContain(strPassword, m_strUpperCase);
var nLowerCount = countContain(strPassword, m_strLowerCase);
var nLowerUpperCount = nUpperCount + nLowerCount;
// -- Letters are all lower case
if (nUpperCount == 0 && nLowerCount != 0)
{
nScore += 10;
}
// -- Letters are upper case and lower case
else if (nUpperCount != 0 && nLowerCount != 0)
{
nScore += 20;
}
// Numbers
var nNumberCount = countContain(strPassword, m_strNumber);
// -- 1 number
if (nNumberCount == 1)
{
nScore += 10;
}
// -- 3 or more numbers
if (nNumberCount >= 3)
{
nScore += 20;
}
// Characters
var nCharacterCount = countContain(strPassword, m_strCharacters);
// -- 1 character
if (nCharacterCount == 1)
{
nScore += 10;
}
// -- More than 1 character
if (nCharacterCount > 1)
{
nScore += 25;
}
// Bonus
// -- Letters and numbers
if (nNumberCount != 0 && nLowerUpperCount != 0)
{
nScore += 2;
}
// -- Letters, numbers, and characters
if (nNumberCount != 0 && nLowerUpperCount != 0 && nCharacterCount != 0)
{
nScore += 3;
}
// -- Mixed case letters, numbers, and characters
if (nNumberCount != 0 && nUpperCount != 0 && nLowerCount != 0 && nCharacterCount != 0)
{
nScore += 5;
}
return nScore;
}
// Runs password through check and then updates GUI
function runPassword(strPassword, strFieldID)
{
// Check password
var nScore = checkPassword(strPassword);
// Get controls
var ctlBar = document.getElementById(strFieldID + "_bar");
var ctlText = document.getElementById(strFieldID + "_text");
if (!ctlBar || !ctlText)
return;
// Set new width
ctlBar.style.width = nScore + "%";
// Color and text
// -- Безупречный
if (nScore >= 90)
{
var strText = "Отличный пароль! Главное не забыть его :)";
var strColor = "#0ca908";
}
// -- Очень хороший
else if (nScore >= 80)
{
var strText = "Очень хороший";
vstrColor = "#7ff67c";
}
// -- Хороший
else if (nScore >= 70)
{
var strText = "Хороший";
var strColor = "#1740ef";
}
// -- Давольно нормальный
else if (nScore >= 60)
{
var strText = "Достаточно неплохо";
var strColor = "#5a74e3";
}
// -- Нормальный
else if (nScore >= 50)
{
var strText = "Нормально";
var strColor = "#e3cb00";
}
// -- Слабый
else if (nScore >= 25)
{
var strText = "Слабенько";
var strColor = "#e7d61a";
}
// -- Очень плохой
else
{
var strText = "Ужас. (qwerty и то лучше :)) ";
var strColor = "#e71a1a";
}
ctlBar.style.backgroundColor = strColor;
ctlText.innerHTML = "" + strText + " - " + nScore + "";
}
// Checks a string for a list of characters
function countContain(strPassword, strCheck)
{
// Declare variables
var nCount = 0;
for (i = 0; i < strPassword.length; i++)
{
if (strCheck.indexOf(strPassword.charAt(i)) > -1)
{
nCount++;
}
}
return nCount;
}
I am really impressed with your writing skills and also
with the layout on your weblog. Is this a paid theme or did
you customize it yourself? Anyway keep up the excellent quality writing, it is rare to see a great blog
like this one nowadays.
plenty of fish dating site - 26-11-19 22:11:25
all the time i used to read smaller posts which also clear their motive, and that is also happening with this
paragraph which I am reading at this time.
http://tinyurl.com/ryc5b8m - 25-11-19 01:11:38
It's nearly impossible to find educated people
on this subject, but you seem like you know what you're talking about!
Thanks
http://tinyurl.com/ - 24-11-19 05:11:46
hey there and thank you for your information – I've certainly picked up anything new from right here.
I did however expertise several technical issues using this
web site, since I experienced to reload the website a lot of times previous to I could get it to load correctly.
I had been wondering if your web hosting is OK?
Not that I am complaining, but slow loading instances
times will very frequently affect your placement in google and could damage your quality score
if ads and marketing with Adwords. Well I am adding this RSS to my e-mail and could look out for a lot more of your respective interesting content.
Make sure you update this again soon.
DavidUteft - 1-02-19 14:02:47
https://u.to/in0zFA Акустическая система Power Sound и PowerBank Remax в подарок
Портативная акустическая система с защитой от брызг и аккумулятором большой емкости.
Позволяет наслаждаться отличным качеством звука без проводов, уникальной подсветкой и множеством других функций.
PowerBank Remax в подарок - https://u.to/in0zFA
***^
DavidUteft - 29-01-19 17:01:00
https://clck.ru/Eew7c "REVOFLEX XTREME" ДЛЯ ЛЮДЕЙ РАЗНОГО УРОВНЯ ПОДГОТОВКИ
Тренажер подходит для людей любого возраста и уровня физической подготовки
Используется для работы со всеми группами мышц. Комбинируя различные техники и уровни нагрузки, вы можете выполнять
до 500 упражнений
Интуитивно понятные упражнения, а также легко настраиваемые уровни нагрузки делают занятия на нем удобными и эффективными
Тренажер легкий, его удобно хранить и можно брать с собой в дорогу. Вы можете использовать для этого специальную сумку, которая
идет с ним в комплекте
***^
ArthurMoofs - 28-01-19 03:01:29
[url=https://clck.ru/EtfqU]похороны майка науменко[/url]
Интернет магазин уникальных футболок. Мы предлагаем Вам только качественные и уникальные товары. На Ваш выбор толстовки, футболки, головные уборы, чехлы, посуда, аксессуары и вещи для интерьера.
Вы с легкостью сможете подобрать рисунок, который Вам нравится или же сделать свой уникальный с помощью конструктора.
Приобретя товр Вы можете воспользоваться услугами доставки на очень выгодных условиях.
Заходи и заказывай:
[url=http://supermayki-ok.ru]Балаклава 3D[/url]
Neewerobini - 26-12-18 05:12:32
To keep your phone charged at all times, itR17;s important to take advantage of the variety of chargers available and choose those that best meet your needs. As soon as you go along with one of these brilliant online specialists, you can expect to be required to submit just a few forms with particulars which will enable the agent to identify what exactly you will want. Sentiments might take owners covering inside permit them a lot, but also, each of these comments sole click as soon as subliminal audio system is impacted homeowners, [url=http://www.cheapwholesalenflnikejerseys.us.com/]Cheap NFL Jerseys Free Shipping[/url],[url=http://www.cheapwholesalenflnikejerseys.us.com/]Wholesale Jerseys China[/url], and even prompted. If you have trouble in this regard, customers will be less than impressed.While some people might not give you the impression that they have good ideas, you never know what they could come up with. This fruit not only reduces the frequency of nightfall, but it also improves erections.While the strong housing market in Auckland has made finding new places challenging, Adams said progress has been made to deliver 621 houses in the country's biggest city by winter, which will support nearly 2,500 Auckland families a year. The canyons in the location are unbelievable. So make sure when you decide which downline builder/list builder to trust for your online business.[url=http://www.cheapwholesalenflnikejerseys.us.com/]Wholesale NFL Jerseys[/url]. On the other hand, it is important to realize how and where to search if you donR17;t like to throw away much time. As soon as you go along with one of these brilliant online specialists, you can expect to be required to submit just a few forms with particulars which will enable the agent to identify what exactly you will want. We will track the company's corrective measuresЈ¬" said Zhang HandongЈ¬ a NDRC official in charge of the anti-monopoly department.Visit my siteЈєhttp://www.cheapwholesalenflnikejerseys.us.com/
Neewerobini - 22-12-18 18:12:21
If your phone starts to lose power, you can just plug in the external battery and recharge it. So I would like to provide you with an additional way of seeking at the questions you ask plus a method to see a brand new light on your automobile searching adventures. So, avoid doing excessive masturbation and herbal remedies for nightfall also may help to control excessive masturbation. You can actually design on a regular basis at heat with building diagrams, [url=http://www.cheapfootballjerseysnfl.us.com/]Wholesale Cheap Jerseys[/url], intellect roadmaps, records, or other products that provides you improvising to do the job through your challenges. Along with an design, which assists to that you definitely order your your feelings contains youR17;ll find anything you perhaps identify along the way akin to subliminal mp3s demanding.Casey Affleck won the best actor award for his role in "Manchester by the SeaЈ¬" which also won Kenneth Lonergan the award for best original screenplay.Ethiopian airline, operating to more than 100 international passenger and cargo destinations across five continents, commands the lion's share of the pan-African passenger and cargo network. Since the premiere of Russell T. The leading Atlanta, GA attractions include the wonderful Georgia Aquarium, Atlantic station, High Museum of Art and therefore the World of Coca-Cola which is situated quite near to the Georgia Aquarium. And the season kicks off with the highly anticipated two-parter in 1960s Utah,[url=http://www.cheapfootballjerseysnfl.us.com/]Wholesale Jerseys No Tax[/url], the first the series has ever filmed on U. The main develop fully song, R20;ItR17;s primarily comments bringing i am via,R21; declares entire.Winner of the award for best special visual effects was The Jungle Book.[url=http://www.cheapfootballjerseysnfl.us.com/]Cheap NFL Jerseys[/url].Visit my siteЈєhttp://www.cheapfootballjerseysnfl.us.com/
Francistic - 4-04-18 17:04:36
The service can also provide traveler kits which contain prescription medications to treat common types of illness early and can also be used to prevent serious disease. Death due to accident injury is not uncommon either.Travel Doctor clinics are prepared to help travelers in preventing illnesses before they happen.There are outlets promoting these brass support frames to anyone that want them." Cover your head, tie your hair, drape it around your neck or sport it carelessly round your hips, a chiffon scarf can serve a variety of purposes. [url=http://www.cheapwholesalenflnikejerseys.us.com/]Cheap NFL Jerseys Free Shipping[/url].Within seconds of the final whistleЈ¬ Leicester City FC was proclaiming its title win on the club's official website.[url=http://www.cheapwholesalenflnikejerseys.us.com/]Wholesale Jerseys Cheap[/url].[url=http://www.cheapwholesalenflnikejerseys.us.com/]Cheap NFL Jerseys China[/url].The main road to the country's Entebbe International Airport was blocked as the police engaged Besigye supporters in running battles.Now, dressing in layers doesn?t just mean anything on top of anything else. Just the fact that I'm still representing the country and getting a chance to be here is good enough for them.In a commando style, the police used a helicopter to teargas and drop officers into the office compound which could not be accessed from outside since the gates where locked from inside. Most garments will tell you on the label if they?re made of a wicking material.Individuals who have experience working in outdoor environments may already be familiar with Carhartt men s clothing.Visit my siteЈєhttp://www.cheapwholesalenflnikejerseys.us.com/
JesseThelm - 20-01-18 14:01:05
Just spread your creativity and find some best ideas to design the envelopes in extraordinary way.Article From Article Directory DatabaseCylinder Valves And Gas TanksCylinder Valves And Gas TanksSeptember 17, 2013 Author: Helene Norris Posted in EducationThere are numerous industrial products that require unique and peculiar modes of transportation and storage, [url=http://www.cheapwholesalenflnikejerseys.com/]Cheap NFL Jerseys[/url], with each product having its own properties and functionality. This article has some great tips to help you out.[url=http://www.cheapwholesalenflnikejerseys.com/]Wholesale NFL Jerseys China[/url]. However, you will not be disappointed with the result of the unique design. You'll find videos that supply demanding vague ideas and give children an experience of achievement. The actual Healthcare Astrologogy has the capacity to research the actual impact associated with exoplanets upon health insurance and illness. Talk to the scores put up through the Amusement Software Standing Aboard (ESRB) on the product packaging. It is also suggested to consume zinc rich foods and practice exercises regularly.[url=http://www.cheapwholesalenflnikejerseys.com/]Wholesale Jerseys[/url].You are advised intake of herbal pills such as Maha Rasayan capsules and No Fall capsules daily twice with water or milk to repair the damaged penile tissue caused due to over masturbation. For your current young young ladies, find people that have characters that will motivate strength as well as achievement.3. The actual horoscope is really a formula from the entire becoming, highlighting the actual complicated conversation associated with entire body, thoughts as well as nature.//////////
JesseThelm - 17-01-18 09:01:55
It will provide you lots of benefits if you will compare their offered features and prices. You need to set some goals for the long haul; they can put things into perspective. Since there are many providers and companies today claiming to be the best, it will help if you will consider reading those reviews and comments made by people who already found the best granny flat builders nsw.The reading glasses are now ? a ? days available with three different kinds of lenses.8 m) long. [url=http://www.cheapfootballjerseysnfl.us.com/]Wholesale NFL Jerseys Cheap[/url]. They even have scoured the web to d??nd somegenuinely good details goods, all related to earning funds with Fiverr.It is allowed to run with the ball in the post. You should continue to add new questions to the list as they come up.Enables them to Market and Sell their ProductsIn terms of advertising and marketing todayR17;s goods and services,[url=http://www.cheapfootballjerseysnfl.us.com/]Wholesale NFL Jerseys[/url], the internet has been a major tool.Place value on the best when it comes to self improvement.An effective suggestion to bear in mind any time considering getting a lawyer is always to make a note of several queries that you want to let him express or the woman's.Individuals who can answer the question R20;What is a domain name?R21; will certainly have a lot easier time understanding how the world wide web works and the ways to run a website.[url=http://www.cheapfootballjerseysnfl.us.com/]Cheap NFL Jerseys Wholesale[/url].Visit my siteЈєhttp://www.cheapfootballjerseysnfl.us.com/
JesseThelm - 2-01-18 14:01:10
All of these automobiles have one thing in common; they all travel on tires. There are no mechanisms in direction of avoid fraudulent certificates for Yahoo Send out or Gmail against currently being issued by means of compromised products and services, or repressive regimes bent upon surveillance, some of which consist of their personal certification federal government. So while Reputation chance should be administered like other vital dangers, it is not frequently tended to adequately. A discoloured picture can intensely affect an association's capacity to offer items, initiate staff and pull in moguls.Compact Luxury:The Mercedes Benz A Class compact luxury cars include the A 180 Sport and the A 200 CDI Sport. [url=http://www.cheapwholesalenflfootballjerseys.com/]Cheap NFL Jerseys USA[/url]. Listing integration: Maximum NGFWs consists of listing guidance generating handle of authorised packages dependent upon customers and consumer types. Most business owners have a great product or service and just give up because of the website.[url=http://www.cheapwholesalenflfootballjerseys.com/]Cheap Jerseys USA[/url]. It gives a fair idea about the increasing scopes and prospects of the Ayurveda learning in India. Please check out mcafeepromocodes. It is conjointly vital for acquiring and holding some control over the social progress in your neighbourhood.In this system electromagnet, rays fall on the infrared range transferring energy in to heat.[url=http://www.cheapwholesalenflfootballjerseys.com/]Cheap NFL Jerseys China[/url].Comparing Fast Answers For Antivirus 2012Fechter Dockstader Submitted 2014 06 19 03:27:07 Who demands in the direction of do office environment with a person they wear't which include or have faith in? This is why oneself have to have a specialized system, bespoke for spam and junk send out filtering toward assistance the fireplace wall and even the anti virus programme that your self are operating upon your Computer.Visit my siteЈєhttp://www.cheapwholesalenflfootballjerseys.com/
JesseThelm - 13-12-17 07:12:14
Hiking and walking nature trails are fun to get outside. Though having into focus the deployment and command things on your own will discover no much better possibility than Bitdefender. [url=http://www.cheapwholesalenflfootballjerseys.com/]Wholesale China Jerseys[/url]. YouR17;ll be able to find quite a bit of information. While you?re bowling you will be using the muscles in arms, legs and the waist.A beauty lover must stay clear of drinking caffeine. Some examples embrace the Dixie Boys baseball Scholarship Program and the Dixie Youth Scholarship Program. It's an admirable and beautiful thing, knocking out a good round with your friends under the great blue sky, getting a sexy suntan, and watching nature as you move from hole to hole. That way, you know that they are clean and ready for use.[url=http://www.cheapwholesalenflfootballjerseys.com/]Cheap Jerseys China[/url]. Warmup exercises that involve stretching before performing any jeu is additionally a very good method to prevent knee pains.[url=http://www.cheapwholesalenflfootballjerseys.com/]Cheap NFL Jerseys China[/url]. Hordes of onsite facilities like 24 hours water, power data backup, sanctuary system; unethical schools, colleges, funny farms, entertainment centers in close vicinity; comfortable and fast connection to any other part of the municipality and around etc.Likelihood is the reason that that your family don't assume an all in one many of the new garage door to build each and every day. Some grants require you to see sports activities as your profession whereas others might solely require you to have a background in a specific field.Visit my siteЈєhttp://www.cheapwholesalenflfootballjerseys.com/
RobertDumma - 10-07-17 10:07:40
Save gas, time, [url=http://www.wholesalemlbjerseyscheap.cc/]Wholesale Jerseys[/url],[url=http://www.wholesalemlbjerseyscheap.cc/]Cheap MLB Jerseys Wholesale[/url], energy, and frustration by calling your local stores to ask if they have clothing in your size range.g.If you wish to build your own self get started performing much more points for some individuals, selflessness is a good trait. Checking the cleanliness of every room might also indicate troubles with dirty air from time to time. The reason why will you purchase expensively when you can buy cheaply? There isn't any reason correct? Yea you are right; there isn't any reason. Chimneys are created to permit smoky air to escape, so unless the flue is closed, heat air escapes, and with it, your heating budget. Surprisingly, you will want to come back with this kind of customer support. They will be able to provide the information you need to answer your questions and help you make the best decision about your comfort needs. On a windy day, maintain a lit incense stick subsequent to areas of potential air paths to the skin, like home windows,[url=http://www.wholesalemlbjerseyscheap.cc/]Wholesale Jerseys Free Shipping[/url], doorways, electrical bins, plumbing fixtures, electrical retailers, and ceiling fixtures.A wind turbine could help you reduced your electronic expenses by around 90Per cent.Tumble in adore, if not romantically then by means of changing your complete perspective and condition of brain on existence along with its joys.Duo31CC USB Car ChargerPortable Devices for Busy LifestylesWe are so busy these days that we simply cannot wait to be at home with a desktop computer to use social media, check emails and the myriad other activities that we perform on a daily basis.Visit my siteЈєhttp://www.wholesalemlbjerseyscheap.cc/
[url=http://quickxcash.com/]quick cash newport ky [/url]
quick cash pawn rocky mount nc
quick cash
how to make quick cash online
Leonardsep - 9-07-17 09:07:37
[url=http://paydayloansdirectlenderx.com/]payday loans direct lender [/url]
online payday loans direct lender
online direct lender payday loans
payday loans bad credit direct lender
biskelsnailia - 9-05-17 06:05:50
And WTF ended up being up having giving LIV TYLER 3rd billing?! OVER Viggo and Sean Astin. You want as many people as possible to be able to efficiently navigate your site.You should never hesitate at all in looking for all of them.Here is an example of SEO in action: You google salons in New York City, and hundreds of search results come back. When next you are attacked by your partner, the only thing you should do is to look out with regard to a Spousal Assault Maryland Defense Lawyer. [url=http://www.wholesalejerseyscheapjerseys.us.com/]Wholesale Jerseys China Free Shipping[/url].. Avoid this by making it easy to locate the information that they are seeking.[url=http://www.wholesalejerseyscheapjerseys.us.com/]Wholesale NFL Jerseys From China[/url].Gucci Diaper Bag assortment may be purchased treat computer systemRenee Mccoun Submitted 20120328 07:22:16 Offering a multi functional a good choice garage door repair appraisal calls gorgeous honeymoons as well experience in the field Just as wilh each of them is mechanicalelectrical techniques garage doors and their related apparatus can churn into a problematic That enables that being able to get ready an all in one garage door repair calculate approximately can be the case a multi functional paintings to do with art."Let's keep our fingers crossed and hope it's only a day or two. But if you see going to be the largest come to mind back on funding as well as for your one of a kind a completely new one objective money is that often all around the front of where all your family members park your car,[url=http://www.wholesalejerseyscheapjerseys.us.com/]Wholesale NFL Jerseys Cheap[/url], store changing your your stuff or otherwise both the Your garage door. They are also given the right understanding of different website areas and how can these site areas be properly handled.Doors allowing you to have raised panels have an too much money a tried and true look The those people productive phase is always that that they may be able to ensure they are painted everywhere in the various how do we one or more can maximize going to be the panels.Visit my siteпїЅпїЅhttp://www.wholesalejerseyscheapjerseys.us.com/
ps4 games - 29-11-19 06:11:22
I am really impressed with your writing skills and also
with the layout on your weblog. Is this a paid theme or did
you customize it yourself? Anyway keep up the excellent quality writing, it is rare to see a great blog
like this one nowadays.