Sealing Data using TPM In Windows [closed] - windows

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'd like to perform a TPM Seal operation in windows. I'm familiar with C++ programming but have no idea what libraries I'd even use.
I'm currently stuck with the following two questions:
Can I perform this action using e.g. WMI and a powershell script? This http://msdn.microsoft.com/en-us/library/windows/desktop/aa446799(v=vs.85).aspx indicates that I can use TBS To Submit a Command, but I don't have the faintest how I would set up the parameters in e.g. WMI.
Can I use the tbs.h/tbs.lib from the Windows 7 SDK to perform a TPM_Seal operation?
Is there a TSS API Like http://trousers.sourceforge.net/ where I can call this from some C++ Code?
The method through which I do this is not a big deal, but I am using TPM 1.2 on windows, and all of my clients are windows.

You can use TPM Base Sevices for sending commands to the TPM. So you need to assemble the commands yourself.
The TPM commands, structures and flows are defined in 3 documents:
Part 1 - Design Principles
Part 2 - Structures of the TPM
Part 3 - Commands
First you need to figure out which command you want to send. Then you have to lookup the command's reference in Part 3 and assembled the needed structures as described in Part 2.
The TPM_seal command for example is defined in section 10.1 on page 72 of Part 3. Line 1331 shows you how the command has to look like. After issuing the command you can evaluate the returned structure according to line 1332. (All numbers apply to revision 116.)
This can be really tricky. However, you can have a look at other implementations. If you just need a few commands it's not that hard, especially when you can be sure that some cornercases don't happen.
I would suggest you start looking at IBM's software TPM. This project also provides libtpm and some utilities. This is one of the lighter implementations I know.
You can also try whether TrouSerS for Windows is stable enough to fit your needs. There you would have a highlevel TSS API.
If Java is an option, have a look at jTSS. It supports Windows.

I was able to do this without much issue with JTSS. There is an example # https://security.stackexchange.com/questions/60841/encrypting-a-symmetric-key-or-small-file-using-tpm-and-windows-tbs

Related

Which testing technology to use for a command-line Ruby app? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I have written a Ruby program that I would like to release as a Gem. It is built using Thor and command_line_reporter. I have been building it while learning, which for me means that I have no tests. Seeing as the community likes and expects tests, which I understand, I feel I should implement this before making the program public.
While this could be taken as asking for opinions, I feel there must be something that fits my specific needs much better than anything else.
Which testing technology should/can be used for a Thor-based Ruby CLI app?
More info: The app allows the user to create a list of their favorite programs with a few fields of accompanying info. It saves all data to a file in JSON format. This is my first complete program and I have never written any tests before.
Perhaps it might help to address HOW to write tests. There are lots of test frameworks, and lots of philosophies of how we should write tests but I try to keep it simple. I generally start with these:
Test to see I got back nil or an object first.
Test to see if the object is the right type.
Test to see if mandatory attributes are set, then if they're the right types.
Once I've got those out of the way I'll start antagonizing the code, throwing out-of-bounds and evil values at it, forcing it to raise its exceptions if it's supposed to do that.
Then, as further use/testing reveal bugs I'd add specific tests to check to see those don't reappear as I screw around with the code. ("Code screwing-around" is gonna happen, so its important I know I didn't make the program go out in flames.)
ZenTest has the autotest command which looks for a change in your test files and runs the tests automatically. It makes it really easy to make sure I haven't borked things, because in a separate console window autotest will be doing its thing each time I save. It's a great-big safety net you'll get used to having very quickly. From the docs:
autotest is a continous testing facility meant to be used during
development. As soon as you save a file, autotest will run the
corresponding dependent tests.
Writing tests are a necessary evil. They'll double your code-writing load, but they're very important to start early and continue maintaining. Trying to add them later to a large code base is a major problem, causing too many apps to never have unit tests. Icky.
Overwhelmingly, the answer to this is "whatever you feel like."
TestUnit and RSpec are both widely used, but it ultimately boils down to whatever you feel fits the needs of your app the best.

Free Linux like "tail -f" for Windows [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Is there alternative to hoo-wintail (costs $49.95) for Windows, which can color specific lines according to pattern in monitored file.
Thanks
I found two options:
BareTail
Tail for Win32
Neither of them uses Cygwin. BareTail apparently has an annoying startup screen. Tail for Win32 is completely free, and open source.
multitail acts like tail -f on multiple files at a time, and it will color lines according to the file type. It's available in Windows as part of Cygwin, which will cost you $0.
Text utilities from gnuwin32 contains tail.
This distribution is a zip file, you can only use tail.exe from this zip.
http://gnuwin32.sourceforge.net/packages/coreutils.htm
It has a dependency. (dep is dependency,bin is actual distribution) Download both of them,extract. Copy
libiconv2.dll
libintl3.dll
from dep to same directory as tail.exe
http://sourceforge.net/projects/gnuwin32/files/coreutils/5.3.0/coreutils-5.3.0-dep.zip/download
http://sourceforge.net/projects/gnuwin32/files/coreutils/5.3.0/coreutils-5.3.0-bin.zip/download
Then tail.exe works normally. But as you say in comments it gives error for "tail -f filename"
Interesting thing is: If you install using their setup package
http://gnuwin32.sourceforge.net/downlinks/coreutils.php.
This error does not exist. But I saw same error when I was trying to use from zip distribution only.
Have you tried this?
"A Windows version of the UNIX 'tail' command. Includes features such as pager or SMTP notification of specific items found within the files being monitored"
http://sourceforge.net/projects/tailforwin32/
HTH
I can recommend LogExpert an other alternatives
Free version of Kiwi Syslog Viewer will do the job.
It has a tail function, and will open very large files quickly and easily.

Can you recommend a good SSH syncing utility? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Can you recommend a good SSH file sync utility for Windows? For example, I have some C++ sources that I need to compile remotely. I need this utility to be simple and most of all responsive, so I can compile my sources instantly after saving, without having to wait for the sync to be triggered.
WinSCP supports synchronization from both gui and command line.
Use rsync. See this. There is even an instruction to set automatic backup.
for source-code, you could use something like git or subversion, paired with an ssh-connection using port-forwarding.
in all cases you would need to trigger the sync yourself except you have a tool that watches the directory you're working on.
try this, SSHSync for windows
http://code.google.com/p/sshsync/
A command line applications that allows intelligent Secure FTP transmissions. SshSync only support pull type transfers, but it allows use of a Private Key to ensure that authentication is secure. A text file that contains a list of files always processed is used to check that only 'new' files are retrieved.
Sounds like a job for a Continuous Integration tool.
install cygwin and use rsync over ssh.
It seems to me that one way to solve your problem would be to simply use a network drive. Edit your files from the network drive, and whenever you save, any other systems connected to that drive can also access your changes, including your build server. That's what we do at my office — everyone's home directories are on NFS/CIFS shares, so we edit on our local computers, but run a script to trigger a build on any of several build servers, even multiple platforms at once. We don't have to sync anything before being allowed to compile our latest changes.

Creating a GUI application that wraps command-line programs on Linux and Windows [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I'm writing a GUI application that will let users interact with command-line programs. The programs are crystallography programs, in this case. They take a long time to run.
There's a certain common workflow using the command-line programs. The output from one program is typically processed and then is used by other programs. The user needs to be able to fill in various text boxes and select options that are sent to the command-line programs.
As I'm lazy and don't want to do more work than I need to, what tools are out there that will help me in doing this? The software needs to work initially on Linux, but also running on Windows at some point would be neat.
Would also be neat if there was some sort of DSL for non-programmers to be able to extend/modify the GUI application (to add new programs and change the options and so on).
Take a look at GTK Server it is easily scriptable from any language and since it runs as a service (bit like a browser) it can be used across systems. That is, the system running the command line stuff can be on a powerful system and the GTK Server running on the user's desktop PC. The examples are easy to follow and the matrix of versions and languages is bound to include yours. If you are unlucky, just pick the closest combination for examples.
I'd suggest having a look at the Galaxy web portal. It is basically a web based GUI to command line bioinformatics tools (but works equally well for any command line application), with workflow capabilities built in, and thus should have exactly what you're looking for.
It should be fairly easy to add your own wrapper, by following Galaxy's tool configuration format. See this page for how to do this.
TCL/TK was the traditional way.
Today I would use python with either wxPython (more complete) or FLTK(simpler).
If you don't need to readback results from the commandline program it's much easier -
eg os.system("command options")
You can use WShell and redirect stdin stdout.
object console = WShell.Exec(cmdLine);
if (console.StdOut.AtEndOfStream)
s = Pipe.StdOut.ReadLine();
Downside that you still have to figure out how to hode console window. But it is easy one. You need to find this window by window title and set its properties to ivisible. Or use freeware some utility from internet which can do it automatically for you.

better command for Windows? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
While I grew up using MSWindows, I transitioned to my much-loved Mac years ago. I don't want to start a flame war here on operating systems. I do, however, want a terminal a litle closer to what I'm used to.
I'm not asking for full POSIX support - I don't have the patience to install Cygwin - but I miss tabbed terminals, being able to easily cut and paste, and my good friends ls, mkdir, rm, et al. (For these last ones, I could always put .bat files on my path, but that's going to get old fast.)
Anybody have a terminal application for MSWindows XP ?
I'm using powershell, its awesome to keep you from going crazy, and it has rm and mkdir and ls.
Tabbed terminals is still not in powershell, and copy paste is similar to cmd, but its way better than cmd.exe.
Some more options:
MSYS: a Minimal SYStem providing a POSIX compatible Bourne shell environment, with a small collection of UNIX command line tools. Primarily developed as a means to execute the configure scripts and Makefiles used to build Open Source software, but also useful as a general purpose command line interface to replace Windows cmd.exe.
GNU utilities for Win32: ports of common GNU utilities to native Win32. In this context, native means the executables do only depend on the Microsoft C-runtime (msvcrt.dll) and not an emulation layer like that provided by Cygwin tools.
PowerCmd is great, with a ton of features including tabs, cut/copy/past, etc.
Console is also a great replacement and is a bit more stripped down than PowerCmd (which can sometimes be a little too feature rich.
Also, with both of these, if you have powershell installed, it is possible to run powershell from withing either.
If you are a bit of a Pythonista then iPython is tough to beat. It has some of the more common shell commands coded in (i.e. ls, pwd, cd etc.), can also run any other shell command by prefixing with '!' (i.e. !latex file.tex) but also is a full Python shell with history, tab-complete, multiline editor support, logging etc. etc.
Moreover, you can install iPython back on your UNIX boxes as well as Windows meaning your environment can follow wherever you go.
There is a new-ish open source Console Emulator called cmder. It looks really nice and has some advanced features that make it nicer to use. You can also use powershell with it. Best of all, it's portable!
I've never found anything I like more than Cygwin.
I also went ahead and installed Cygwin/X w/ Openbox so I can get something like this:
It's got multiple workspaces inside the main Openbox window so I can easily have up to 20 non-overlapping xterms that I can easily cycle through.
I know you said you don't want to install anything, but I strongly suggest you give Services For Unix a shot:
http://technet.microsoft.com/en-us/interopmigration/bb380242.aspx
I use Console with unxutils
Console for the tabs and easier to manage select/copy/paste
unxutils for ls, rm, grep, uniq, sort ... and other goodness.
PowerShell is amazing, however for anything other than the most basic commands there is a learning curve when switching from bash etc.
I went back to using cygwin.
PowerShell is worth looking into.

Resources