Function ENCRYPT (Inpass In Varchar2,IN_GH In Varchar2,IN_SS In Varchar2)
Return Varchar2 Is
bcs varchar2(20);
bcs1 number;
cs number;
jg number;
m_gh VARCHAR2(4);
m_mm VARCHAR2(20);
Begin
m_gh:=IN_GH;
m_mm:=INPASS;
cs:=TO_NUMBER(IN_SS);
If cs<=1 then cs:=77 ;end if;
bcs:=substr(to_char(ascii(substr(m_gh,1,1))),1,2);
If bcs<‘1‘ then bcs:=‘7‘ ;end if;
m_gh:=substr(m_gh,2);
Loop EXIT WHEN nvl(length(m_gh),0)=0 ;
bcs:=bcs||substr(to_char(ascii(substr(m_gh,1,1))),-1,1);
m_gh:=substr(m_gh,2);
End loop;
Loop EXIT WHEN nvl(length(m_mm),0)=0 ;
bcs:=bcs||substr(to_char(ascii(substr(m_mm,1,1))),-1,1);
m_mm:=substr(m_mm,2);
End loop;
bcs1:=to_number(bcs);
jg:=cs*bcs1;
Loop EXIT WHEN length(to_char(jg))>13;
jg:=jg*cs ;
End loop;
RETURN(IN_SS||substr(to_char(jg),1,14));
End;
/
总结上面的东西,我们仅仅是从自身做起,知道了怎么维护Oracle数据库安全这个话题的“皮毛”。可是,对于这个似乎永远也说不完的话题,我们光知道怎么从内部“防御”就够了吗?不要忘了,在外面,还有一群虎视耽耽的“hacker”在盯着你的数据库--因为这里面有他们想要的东西。
文章来源于领测软件测试网 https://www.ltesting.net/