참고로 여기에 게시하고 있습니다. JSL의 암호화된 클래스는 안전하지 않습니다.함수는 이에 취약하지 않으므로 클래스가 아닌 함수만 사용하는 것이 좋습니다.
문제는 JMP 클래스가 내성적이지만 컴파일된 함수는 그렇지 않다는 사실에 있습니다.내가 정말로 비밀로 하고 싶은 메소드가 포함된 다음 클래스를 고려하십시오.
Define Class(
"complex",
real = 0;
imag = 0;
_init_ = Method( {a, b},
real = a;
imag = b;
);
secret method = Method( {secret input 1, secret input 2 = "foo"},
{Default Local},
my secret password = "password123";
my secret connection database = "database=UML_4x7z;source=axml1131;pwd=my_great_password";
Eval( Eval Expr(
my ultra secret program = Run Program(
Executable( "secret_exe.exe" ),
Options( Expr( "-o " || my secret connection database ) )
)
) );
);
Add = Method( {y},
New Object( complex( real + y:real, imag + y:imag ) )
);
Sub = Method( {y},
New Object( complex( real - y:real, imag - y:imag ) )
);
Mul = Method( {y},
New Object( complex( real * y:real - imag * y:imag, imag * y:real + real * y:imag ) )
);
Div = Method( {y},
t = New Object( complex( 0, 0 ) );
mag2 = y:Magsq();
t:real = real * y:real + imag * y:imag;
t:imag = imag * y:real + real * y:imag;
t:real = t:real / mag2;
t:imag = t:imag / mag2;
t;
);
Magsq = Method( {},
real * real + imag * imag
);
Mag = Method( {},
Sqrt( real * real + imag * imag )
);
_to string_ = Method( {},
Char( real ) || " + " || Char( imag ) || "i"
);
_show_ = _to string_;
);이 스크립트를 가져와서 암호화하면(Edit->Encrypt Script...를 사용하여) 내부 코드를 배포할 수 있는 최종 사용자가 내부 코드를 쉽게 볼 수 없어야 합니다.그러나 이것은 사실이 아닙니다.실제로 분해하고 재구성하는 것은 엄청나게 쉽습니다.
다음은 암호화된 메서드를 분해할 수 있는 몇 가지 함수입니다(이것이 문제입니다). 편의를 위해 재구성합니다.
clref = New Object( complex( 1, 2 ) );
introspect = Function( {obj},
{Default Local},
i = 1;
obj part = Arg( obj, 1 );
ret = Eval List( {Head Name( obj part )} );
While( !Is Empty( Arg( obj part, i ) ),
moil = Eval List({Arg( obj part, i)} );
ret[N Items( ret ) + 1] = If( N Arg( Arg( moil, 1 ) ) > 0, Recurse( moil ), Head Name( Arg( moil, 1 ) ) );
i++
);
ret
);
Clear Log();
deconstructed = introspect( Eval List( {Name Expr( clref:secret method )} ) );
Show( deconstructed );
reconstruct = Function( {input},
{Default Local},
init = Parse( input[1] || "()" );
If( Is List( input ) & N Items( input ) > 1,
For( i = 2, i <= N Items( input ), i++,
If( Is List( input[i] ),
Insert Into( init, Try( ( s = Recurse( input[i] ); s )[1], Char( s ) ) )
,
Insert Into( init, Parse( input[i] ) )
)
);
);
Eval List( {Name Expr( init ) } );
);
Show( reconstruct( v ) );여기에는 두 가지 주의 사항이 있습니다. 문자열과 이름을 쉽게 구분할 수 없으며(그러나 인간은 아마도 할 수 있습니다), 다음과 같은 구조의 중심 인수에 대한 가시성이 없습니다. 클래스:메서드(arg1, arg2):returned_class_method(arg); , 여기서 첫 번째 메서드는 메서드를 추가로 호출하는 클래스를 반환합니다.이러한 제한 사항에도 불구하고 암호/민감한 정보에 대한 구현 세부 정보를 매우 빠르게 찾을 수 있습니다.
다시 말하지만, 보안 목적으로 스크립트/여러 스크립트를 암호화하는 경우 클래스에 의존하지 않는 것이 좋습니다.
알아 둘만 한.나는 이것을 보내는 것이 좋습니다 support@jmp.com 당신이 아직하지 않은 경우뿐만 아니라.