Jump to content

LabView Security(Encrypt vi,Decrypt vi)


Recommended Posts

Hi guys, i tryin connect to labview web serv through java application, and have some troubles.

I already readed this:
http://muree.psut.edu.jo/Documents/DEV4.2-Services%20Adaptation%20to%20Connect%20Remote%20Labs%20to%20VLE-Securing%20WS%20in%20LabVIEW.pdf

http://www.ni.com/white-paper/7749/en/

How i must encrypt my body through java? What happened with data when they go to Encrypt Vi?

post-54590-0-67734800-1459951339.png


Thx for ur help

Link to comment

Well to answer your direct question of what is this, here is the help on these functions.

 

http://zone.ni.com/reference/en-XX/help/371361M-01/lvcomm/encrypt_http/

http://zone.ni.com/reference/en-XX/help/371361M-01/lvcomm/decrypt_http/

 

More specifically they call the DLL at the following location:

 

<LabVIEW Install Folder>\resource\ni_httpClient.dll

 

With the function ni_httpClient_Encrypt or ni_httpClient_Decrypt.  Beyond that I can't say what it is actually doing.  Would calling that DLL from Java be an acceptable solution if you knew the parameters and data types?

Link to comment

These functions use some encryption that is built into NI's web servers, I forget exactly what for, but I have thought I got lucky before and proven to be wrong!

 

What sort of encryption do you need?

 

Most commonly with http you would make the server support HTTPS and then LabVIEW client can support this and means your data is encrypted in flight.

Link to comment

Ok guys, thx for ur answers. I decompiled ni_httpClient.dll and gote this:

int64_t ni_httpClient_Encrypt(int32_t* rcx, void** rdx, void** r8, void** r9) {
	void* rsp5;
	int64_t rax6;
	void* rsp7;
	void* rsp8;
	void* rsp9;
	void** rdx10;
	struct s24* rcx11;
	int32_t eax12;
	void* rsp13;
	void* rsp14;
	void** r9_15;
	void** r8_16;
	void* rsp17;
	struct s25* rcx18;
	void* rsp19;
	void** rcx20;
	void* rsp21;
	void* rsp22;

	rsp5 = reinterpret_cast<void*>(reinterpret_cast<int64_t>(__zero_stack_offset()) - 8 - 0x210);
	if (!rcx || (!*rcx || (!rdx || (!r8 || !r9)))) {
		*reinterpret_cast<int32_t*>(&rax6) = 1;
		*reinterpret_cast<int32_t*>(reinterpret_cast<int64_t>(&rax6) + 4) = 0;
	}
	else {
		0_basic_string_DU_char_traits_D_std_V_allocator_D_2_std_QEAA_XZ(reinterpret_cast<int64_t>(rsp5)+0x70);
		rsp7 = reinterpret_cast<void*>(reinterpret_cast<int64_t>(rsp5)-8 + 8);
		fun_180005520(reinterpret_cast<int64_t>(rsp7)+0xc0, rdx, r8);
		rsp8 = reinterpret_cast<void*>(reinterpret_cast<int64_t>(rsp7)-8 + 8);
		fun_1800054b0(reinterpret_cast<int64_t>(rsp8)+0x98, r8, r8);
		rsp9 = reinterpret_cast<void*>(reinterpret_cast<int64_t>(rsp8)-8 + 8);
		*reinterpret_cast<int32_t*>(&rdx10) = *rcx;
		*reinterpret_cast<int32_t*>(&rdx10 + 4) = 0;
		*reinterpret_cast<unsigned char*>(&r8) = static_cast<unsigned char>(reinterpret_cast<uint1_t>(*reinterpret_cast<int32_t*>(&rdx10) == 0));
		rcx11 = reinterpret_cast<struct s24*>(reinterpret_cast<int64_t>(rsp9)+32);
		fun_180006940(rcx11, rdx10, r8, rcx11, rdx10, r8);
		eax12 = fun_18000fd50(fun_180005a60, 0, 6, r9, fun_180005a60, 0, 6, r9);
		rsp13 = reinterpret_cast<void*>(reinterpret_cast<int64_t>(rsp9)-8 + 8 - 8 + 8);
		if (eax12) {
			0exception_std_QEAA_XZ(reinterpret_cast<int64_t>(rsp13)+0xe8, 0, 6);
			rsp14 = reinterpret_cast<void*>(reinterpret_cast<int64_t>(rsp13)-8 + 8);
			strncpy(reinterpret_cast<int64_t>(rsp14)+0x108, "source\\ni\\httpClient\\export.cpp", 0x100);
			fun_18001cf02();
			rsp13 = reinterpret_cast<void*>(reinterpret_cast<int64_t>(rsp14)-8 + 8 - 8 + 8);
		}
		r9_15 = reinterpret_cast<void**>(reinterpret_cast<int64_t>(rsp13)+0x70);
		r8_16 = reinterpret_cast<void**>(reinterpret_cast<int64_t>(rsp13)+0x98);
		fun_180001c80(0, reinterpret_cast<int64_t>(rsp13)+0xc0, r8_16, r9_15);
		rsp17 = reinterpret_cast<void*>(reinterpret_cast<int64_t>(rsp13)-8 + 8);
		rcx18 = reinterpret_cast<struct s25*>(reinterpret_cast<int64_t>(rsp17)+0x70);
		fun_18000a020(rcx18, r9, r8_16, r9_15, rcx18, r9, r8_16, r9_15);
		rsp19 = reinterpret_cast<void*>(reinterpret_cast<int64_t>(rsp17)-8 + 8);
		rcx20 = reinterpret_cast<void**>(reinterpret_cast<int64_t>(rsp19)+32);
		fun_1800070f0(rcx20, rcx20);
		rsp21 = reinterpret_cast<void*>(reinterpret_cast<int64_t>(rsp19)-8 + 8);
		1_basic_string_DU_char_traits_D_std_V_allocator_D_2_std_QEAA_XZ(reinterpret_cast<int64_t>(rsp21)+0x98, r9, r8_16, r9_15);
		rsp22 = reinterpret_cast<void*>(reinterpret_cast<int64_t>(rsp21)-8 + 8);
		1_basic_string_DU_char_traits_D_std_V_allocator_D_2_std_QEAA_XZ(reinterpret_cast<int64_t>(rsp22)+0xc0, r9, r8_16, r9_15);
		1_basic_string_DU_char_traits_D_std_V_allocator_D_2_std_QEAA_XZ(reinterpret_cast<int64_t>(rsp22)-8 + 8 + 0x70, r9, r8_16, r9_15);
		*reinterpret_cast<int32_t*>(&rax6) = eax12;
		*reinterpret_cast<int32_t*>(reinterpret_cast<int64_t>(&rax6) + 4) = 0;
	}
	return rax6;
}

Now i try use that dll in java. I cant use JNI, cose havent source of dll, so i would try use Java Native Acces.
 

P.S. Maybe somebody know what this code doin?

Link to comment

Attached is the VI performing the DLL calls and I think doing the same work as your original VI, notice there isn't anything in terms of error handling so you may want to check the return type to ensure it has no error.  It should give you the prototypes you need to call this DLL outside of LabVIEW.  Although I've never done this type of thing before, is there some legal notice that should go along with this DLL?  I'd assume you are allowed to distribute it since building an EXE in LabVIEW will include it.

Encrypt Decrypt Demo Using DLL 2014.vi

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.