Identify two features of obfuscation. (Choose two.)

Identify two features of obfuscation. (Choose two.)

Identify two features of obfuscation. (Choose two.)

A.
The Import and Export utilities accept wrapped files.

B.
SQL’ Plus cannot process the obfuscated source files.

C.
Only the wrap utility can obfuscate multiple programs at a time.

D.
Both the DBMS_DDL package and the Wrap utility can obfuscate multiple programs at a time.

E.
The source code is visible only through the DBA_SOURCE view and not through the USER_SOURCE or ALL_SOURCE View



Leave a Reply 11

Your email address will not be published. Required fields are marked *


sergey

sergey

I have a doubt here, the answer C says only the wrap utility can obfuscate multiple programs at a time ….. that’s a very ambiguous answer the definition of wrap is
wrap iname=input_file [ oname=output_file ]
so strictly speaking it can only process one file at a time even if you can pipe the results of find or write a simple shell script to get it to obfuscate multiple programs at the same time.
Similarly DBMS_DDL.CREATE_WRAPPED can only compile one source text string at a time but it can be used to compile multiple wrapped programs in a single invocation if you read from files and pass each source text as its parameter.

So C or D??? The answers here are pretty imprecise.

Nishant

Nishant

It said multiple programs and not multiple files.

A file can contain multiple programs due to which C will be an answer along with A.

qaisarimtiaz

qaisarimtiaz

Answer A and C
The wrap utility processes an input SQL file and obfuscates only the PL/SQL units in the file, such as a package specification, package body, function, procedure, type specification, or type body.

The DBMS_DDL package contains procedures for obfuscating a single PL/SQL unit, such as a package specification, package body, function, procedure, type specification, or type body.
The Import and Export utilities accept wrapped files. You can back up or move wrapped procedures.

http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/wrap.htm#i3532

Leo Yu

Leo Yu

thanks, nice answering

P0

P0

A and C.

D is wrong cause:
Your source code is not visible through the USER_SOURCE, ALL_SOURCE, or *DBA_SOURCE* data dictionary views.

Manuel

Manuel

Las respuestas correctas son la opción A y C.

A) la utilidad export y import pueden leer archivos wrapped.
C)la diferencia entre la utilidad wrap y el paquete DBMS_DDL es que la utilidad puede ofuscar solo las unidades de código PL/SQL dentro del archivo de entrada que lee. Sin embargo el paquete PL/SQL solo puede ofuscar una unidad de código PL/SQL a la vez.

Ejemplo:utilizando la utilidad wrap

1.- Abrir un archivo de texto plano e ingresar el siguiente bloque PL/SQL.
CREATE PROCEDURE wraptest IS
TYPE emp_tab IS TABLE OF employees%ROWTYPE INDEX BY PLS_INTEGER;
all_emps emp_tab;
BEGIN
SELECT * BULK COLLECT INTO all_emps FROM employees;
FOR i IN 1..10 LOOP
DBMS_OUTPUT.PUT_LINE(‘Emp Id: ‘ || all_emps(i).employee_id);
END LOOP;
END;
/

Guarda el archivo con extensión prueba.SQL

2.-En una terminal en linux emitir el siguiente comando:
wrap iname=prueba.sql oname=prueba.plb
3.- Conectarse a la BD con SQL*plus , con el usuario hr y ejecutar el archivo con extensión .plb como ejecutamos un archivo con extensión .SQL
4.- @prueba.plb
5- Ejecutar la siguiente consulta para ver el código fuente, observar que el cuerpo del bloque fue ofuscado, la definición no es ofuscada, los comentarios son descartados, no puedes ofuscar sentencias SQL y no puedes ofuscar un trigger.

SELECT * FROM user_source WHERE name=’WRAPTEST’;

Ejemplo: ofuscando con el paquete DBMS_DDL

Como usuario hr ejecutar lo siguiente:

DECLARE
— the package_text variable contains the text to create the package spec and body
package_text VARCHAR2(32767);
FUNCTION generate_spec (pkgname VARCHAR2) RETURN VARCHAR2 AS
BEGIN
RETURN ‘CREATE PACKAGE ‘ || pkgname || ‘ AS
PROCEDURE raise_salary (emp_id NUMBER, amount NUMBER);
PROCEDURE fire_employee (emp_id NUMBER);
END ‘ || pkgname || ‘;’;
END generate_spec;
FUNCTION generate_body (pkgname VARCHAR2) RETURN VARCHAR2 AS
BEGIN
RETURN ‘CREATE PACKAGE BODY ‘ || pkgname || ‘ AS
PROCEDURE raise_salary (emp_id NUMBER, amount NUMBER) IS
BEGIN
UPDATE employees SET salary = salary + amount WHERE employee_id = emp_id;
END raise_salary;
PROCEDURE fire_employee (emp_id NUMBER) IS
BEGIN
DELETE FROM employees WHERE employee_id = emp_id;
END fire_employee;
END ‘ || pkgname || ‘;’;
END generate_body;

BEGIN
package_text := generate_spec(’emp_actions’); — generate package spec
SYS.DBMS_DDL.CREATE_WRAPPED(package_text); — create and wrap the package spec
package_text := generate_body(’emp_actions’); — generate package body
SYS.DBMS_DDL.CREATE_WRAPPED(package_text); — create and wrap the package body
END;
/

— call a procedure from the wrapped package
CALL emp_actions.raise_salary(120, 100);

2.- ejecutar la siguiente consulta.
SELECT text FROM USER_SOURCE WHERE name = ‘EMP_ACTIONS’;

piero

piero

A,C

ma lo ritengo un tranello mica male….
se il test è questo e ci sono pochissimi minuti per rispondere,
ma chi lo passa ?

Uladzimir

Uladzimir

A, C

http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/wrap.htm#i3532

Input and Output Files for the PL/SQL wrap Utility

The input file can contain any combination of SQL statements. Most statements are passed through unchanged. CREATE statements that define subprograms, packages, or object types are obfuscated; their bodies are replaced by a scrambled form that the PL/SQL compiler understands.