الانتقال إلى المحتوى
View in the app

A better way to browse. Learn more.

مجموعة مستخدمي أوراكل العربية

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

تشفير عمود الباسورد

Featured Replies

بتاريخ:

انا اعمل على
database 9i
اريد تشفير عمود الباسورد في جدول المستخدمين
(encrypted)

بتاريخ:

الاخ الكريم

ممكن انك تعمل فورم او اجراء خاص بك للتشفير
حيث تقوم بتحويل كل حرف بحرف آخر او برمز آخر او رقم بحيث تدخل كلمة السر بشكل طبيعي

تاخذ طول الكلمة ثم تقوم بعمل loop حسب طول الكلمة ثم تقوم بالتقسيم عن طريق استخدام function اسمها substr وبعدها تقوم بالتحويل الحرف عن طريق استخدام ال if statment ثم تستخدم concatination ورمزها هو || للقيام بعملية الدمج ثم تخزنها
وتقوم بالتخزين
وثم تسترجع الكلمة الاصلية بنفس الطريقة
حيث تعكس العملية
كما يلي

declare
d number;
t varchar2(20);
tvar char(1);
newchar varchar2(100);
begin
d:= length(:your_password);
t:=:your_password;
for i in 1 ..d loop
tvar:=substr(t,1,i);
if initcap(tvar) ='A' then
newchar:=newchar || '$';
elsif initcap(tvar) ='B' then
newchar:=newchar || '%;
elsif initcap(tvar) ='C' then
newchar:=newchar || '*';
elsif .....
end loop;
update my_user set pass=newchar where usr=:your_user;
commit_form;
end;


طبعا هذي الجزئية الأولى

الجزئية عند الدخول يجب فك كلمة السر

declare
d number;
t varchar2(20);
tvar char(1);
newchar varchar2(100);
begin
select pass into t from my_user where usr=:your_user;
d:= length(t);
for i in 1 ..d loop
tvar:=substr(t,1,i);
if initcap(tvar) ='$' then
newchar:=newchar || 'A';
elsif initcap(tvar) ='%' then
newchar:=newchar || 'B;
elsif initcap(tvar) ='*' then
newchar:=newchar || 'C';
elsif .....
end loop
if newchar<>:your_enter then
 message('the password was wrong');
else 
call_form('your_form');
end if;
end;



طبعا استخدم التشفير التابع للأوراكل افضل وأأمن طبعا اقصد بالتشفير الاوراكل هو انشاء يوزر على الاوراكل وليس تخزين اسماء يوزر على الشاشة فقط
بس هذه احدى الافكار

بتاريخ:
  • كاتب الموضوع

شكرا جزيلا على الرد
ولكن هل يوجد في الاوراكل خاصية تجعل العمود مشفر مثل
alter table
add pass encrypt

بتاريخ:

Hi All My Friends
====================================================
SETUP

Step 1. Creation of a security table

SQL> create table security_table (username varchar2(30),input_date DATE,Secure_data varchar2(80));

Step 2. Creation of a procedure to store encrypted data in the security table



CREATE OR REPLACE PROCEDURE

Insert_encrypt_data(l_string in VARCHAR2,

l_key in varchar2)

as

l_data varchar2(2000);

Key_check_flag number;

l_encrypted_string varchar2(2000);

BEGIN

--- the key and the input data must have a length

-- divisible by eight (the key must be exactly 8 bytes long).

--

l_data := RPAD(l_string,(TRUNC(LENGTH(l_string)/8)+1)*8,CHR(0));

key_check_flag := mod(length(l_key),8);

if key_check_flag != 0 then

Raise_application_error(-20199,'Key should be 8 char long');



end if;

--

-- Encrypt the input string

--

DBMS_OBFUSCATION_TOOLKIT.DESENCRYPT

(input_string => l_data,

key_string => l_key,

encrypted_string => l_encrypted_string);



--

--DBMS_OUTPUT.PUT_LINE('l_string ENCRYPTED: ' || l_encrypted_string);

--

--

insert into security_table values(user,sysdate,l_encrypted_string);

commit;

-- Dbms_output.put_line('Encrypted data inserted');

END;

/







Step 3: Creation of a procedure to decrypt data from the security table



CREATE OR REPLACE PROCEDURE

Decrypt_encrypted_data(l_key in varchar2,decrypt out varchar2)

as

cursor c1 is select secure_data from security_table;

l_data varchar2(2000);

Key_check_flag number;

l_decrypted_string varchar2(2000);

BEGIN

for c1rec in c1 loop

--

-- Both the key and the input data must have a length

-- divisible by eight (the key must be exactly 8 bytes long).

--

key_check_flag := mod(length(l_key),8);

if key_check_flag != 0 then

Raise_application_error(-20199,'Key should be 8 char long');

end if;





DBMS_OBFUSCATION_TOOLKIT.DESDECRYPT

(input_string => c1rec.secure_data,

key_string => l_key,

decrypted_string => l_decrypted_string);

-- DBMS_OUTPUT.PUT_LINE('l_string DECRYPT: ' || l_decrypted_string);

decrypt := l_decrypted_string;

end loop;

END;

/



SETUP HAS COMPLETED , NOW LET US SEE HOW IT WORKS



Execute the procedure for inserting encrypted data



ora816 SamSQL :> execute insert_encrypt_data('YOU ARE INSERTING ENCRYPTED INFORMATION IN SECURITY TABLE','SECURITY');



PL/SQL procedure successfully completed.



Elapsed: 00:00:00.91

ora816 SamSQL :> select * from security_table;



USERNAME INPUT_DAT SECURE_DATA

------------ --------- ------------------------------------------------------------------------------

SCOTT 13-APR-01 ║ªv¿-▲(┘↔N¡Z╓∞Å♥d♣¢·├5♫nk╟à@x?e╢~w►╔■(╣9]Ot ╬↕Dδ╕▐╪⌐⌐=∩Φ╧s╞²‼▓



Elapsed: 00:00:00.30



In the above example

SECURITY is a key and 'YOU ARE INSERTING ENCRYPTED INFORMATION IN SECURITY TABLE' is a Data in a SECURE_DATA column as above which we stored in the encrypted form.



Remember that your key should be exactly of 8 bytes and your data should be multiple of 8 bytes. My procedure insert_encrypt_data is taking care of multiplication of 8 bytes string through RPAD function.



Now we will see how encrypted data will return in decrypted form



ora816 SamSQL :> set serveroutput on

ora816 SamSQL :> set autoprint on

ora816 SamSQL :> var decrypt_String varchar2(2000)

ora816 SamSQL :> execute Decrypt_encrypted_data('SECURITY',:decrypt_string);



PL/SQL procedure successfully completed.





DECRYPT_STRING

---------------------------------------------------------

YOU ARE INSERTING ENCRYPTED INFORMATION IN SECURITY TABLE

بتاريخ:

tمشكور اخي
وادخلك الله الجنة ووقاك عذاب النار

بتاريخ:
  • كاتب الموضوع

شكرا جزيلا للاخين
admin05&oraclepro
على الرد وكل غام وانتم بخير بمناسبة العيد الاضحى

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية

Account

Navigation

البحث

إعداد إشعارات المتصفح الفورية

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.