我可以用密码保护应用程序吗?
我有一个应用程序,除非获得明确许可(通过密码),否则我不希望人们访问该应用程序。更具体地说,除非用户输入密码,否则该应用程序需要在一天中的某些时间“锁定”。
检查时间的能力很简单。我不知道如何锁定应用程序。需要这样做的原因是公司不信任用户注销并且不希望任何未经授权的访问应用程序。这是为了以防万一而采取的最后措施。
但我没有编写该应用程序,因此我无法将密码嵌入其中。该机器只有一个用户,我不想创建其他用户。我的用户也是管理员,因此大多数吸引使用操作系统来提供安全性的选项都不起作用。
关于如何实现这一目标有什么想法吗? 我正在处理 Mac OS X,但更喜欢独立于操作系统的解决方案。欢迎任何涉及 C
或 C++
的解决方案。
谢谢!
I have an application which I don't want people to access unless given explicit permission (via a password). More specifically, this application needs to be "locked" during certain hours of the day unless the user enters a password.
The ability to check the time is simple. The ability to lock the application is what I don't know how to do. The reason that this needs to be done is that the company doesn't trust the user to log out and doesn't want any unauthorized access to the application. This is meant as a sort of last measure just in case.
I didn't write the application though, so I cant embed a password into it. The machine has only one user and I don't want to create others. My user is an admin as well, therefore most options appealing to use of the os to provide security wont work.
Any ideas on how to accomplish this?
I'm dealing with Mac OS X but would prefer an OS independent solution. Any solution involving C
or C++
is welcome.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
将应用程序嵌入到加密的磁盘映像包中怎么样?只要使用它的唯一用户永远不会从那里复制它并在之后正确卸载捆绑包,我认为它会实现您想要的:
之后,当用户双击桌面上的别名时,系统会提示用户输入 DMG 的密码。如果正确,则会安装 DMG,并且应用程序会自动直接启动。
要之后自动卸载,也许您可以编写使用
diskutil
shell 命令的脚本,如下所示:> diskutil unmount /Volumes/DMG_NAME
然后您所要做的就是:
How about you embed the app in an encrypted disk image bundle? As long as the only user that uses it never copies it from there and properly unmounts the bundle afterwards, i think it would accomplish what you want:
After that, when the user double-clicks the alias on the desktop, the user is prompted for the DMG's password. If it's correct, the DMG is mounted and the app is started automatically and directly.
To auto-unmount afterwards perhaps you could script something that uses the
diskutil
shell command, like this:> diskutil unmount /Volumes/DMG_NAME
All you have to do then is:
显然,通过这种设置,没有什么是 100% 安全的,但对于临时用户,您可以使用密码加密应用程序,然后编写一个启动应用程序,在输入密码时解密并启动应用程序,并在输入密码时删除应用程序。退出。
Obviously with this set-up nothing's going to be 100% secure, but for casual users you can encrypt the application with the password, then write a launching application that decrypts and launches the application when the password is entered, and deletes the application when it quits.
应该和您可能编写的任何其他代码一样工作,并且具有简单性和可移植性的优点。
Should work as well as anything else you might code, and has the advantage of simplicity and portability.