新聞中心
ORACLE密碼策略非常重要,下面就為您詳細介紹ORACLE密碼策略驗證程序,如果您對ORACLE密碼策略方面感興趣的話,不妨一看。

成都創(chuàng)新互聯(lián)致力于互聯(lián)網(wǎng)網(wǎng)站建設(shè)與網(wǎng)站營銷,提供成都網(wǎng)站設(shè)計、成都做網(wǎng)站、網(wǎng)站開發(fā)、seo優(yōu)化、網(wǎng)站排名、互聯(lián)網(wǎng)營銷、小程序制作、公眾號商城、等建站開發(fā),成都創(chuàng)新互聯(lián)網(wǎng)站建設(shè)策劃專家,為不同類型的客戶提供良好的互聯(lián)網(wǎng)應(yīng)用定制解決方案,幫助客戶在新的全球化互聯(lián)網(wǎng)環(huán)境中保持優(yōu)勢。
密碼字符串要求:
-- Check if the password is same as the username
-- Check for the minimum length of the password
-- Check if the password contains at least one letter, one digit and one
-- Check if the password differs from the previous password by at least
CREATE OR REPLACE FUNCTION SYS.verify_function
(username varchar2,
password varchar2,
old_password varchar2)
RETURN boolean IS
n boolean;
m integer;
differ integer;
isdigit boolean;
ischar boolean;
ispunct boolean;
digitarray varchar2(20);
punctarray varchar2(25);
chararray varchar2(52);
BEGIN
digitarray:= '0123456789';
chararray:= 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
punctarray:='!"#$%&()``*+,-/:;<=>?_';
-- Check if the password is same as the username
IF NLS_LOWER(password) = NLS_LOWER(username) THEN
raise_application_error(-20001, 'Password same as or similar to user');
END IF;
-- Check for the minimum length of the password
IF length(password) < 8 THEN
raise_application_error(-20002, 'Password length less than 8');
END IF;
-- Check if the password is too simple. A dictionary of words may be
-- maintained and a check may be made so as not to allow the words
-- that are too simple for the password.
IF NLS_LOWER(password) IN ('welcome', 'database', 'account', 'user', 'password', 'oracle', 'computer', 'abcd') THEN
raise_application_error(-20002, 'Password too simple');
END IF;
-- Check if the password contains at least one letter, one digit and one
-- punctuation mark.
-- 1. Check for the digit
- isdigit:=FALSE;
- m := length(password);
- FOR i IN 1..10 LOOP
- FOR j IN 1..m LOOP
- IF substr(password,j,1) = substr(digitarray,i,1) THEN
- isdigit:=TRUE;
- GOTO findchar;
- END IF;
- END LOOP;
- END LOOP;
- IF isdigit = FALSE THEN
- raise_application_error(-20003, 'Password should contain at least one digit, one character and one punctuation');
- END IF;
-- 2. Check for the character
- <
> - ischar:=FALSE;
- FOR i IN 1..length(chararray) LOOP
- FOR j IN 1..m LOOP
- IF substr(password,j,1) = substr(chararray,i,1) THEN
- ischar:=TRUE;
- GOTO findpunct;
- END IF;
- END LOOP;
- END LOOP;
- IF ischar = FALSE THEN
- raise_application_error(-20003, 'Password should contain at least one
- digit, one character and one punctuation');
- END IF;
-- 3. Check for the punctuation
- <
> - ispunct:=FALSE;
- FOR i IN 1..length(punctarray) LOOP
- FOR j IN 1..m LOOP
- IF substr(password,j,1) = substr(punctarray,i,1) THEN
- ispunct:=TRUE;
- GOTO endsearch;
- END IF;
- END LOOP;
- END LOOP;
- IF ispunct = FALSE THEN
- raise_application_error(-20003, 'Password should contain at least one
- digit, one character and one punctuation');
- END IF;
- <
> - -- Check if the password differs from the previous password by at least
- -- 3 letters
- IF old_password IS NOT NULL THEN
- differ := length(old_password) - length(password);
- IF abs(differ) < 3 THEN
- IF length(password) < length(old_password) THEN
- m := length(password);
- ELSE
- m := length(old_password);
- END IF;
- differ := abs(differ);
- FOR i IN 1..m LOOP
- IF substr(password,i,1) != substr(old_password,i,1) THEN
- differ := differ + 1;
- END IF;
- END LOOP;
- IF differ < 3 THEN
- raise_application_error(-20004, 'Password should differ by at
- least 3 characters');
- END IF;
- END IF;
- END IF;
- -- Everything is fine; return TRUE ;
- RETURN(TRUE);
- END;
網(wǎng)頁題目:ORACLE密碼策略驗證程序
文章位置:http://m.fisionsoft.com.cn/article/ccojdse.html


咨詢
建站咨詢
