Search Results

Search found 101795 results on 4072 pages for 'encrypting file system'.

Page 56/4072 | < Previous Page | 52 53 54 55 56 57 58 59 60 61 62 63  | Next Page >

  • Am I encrypting my passwords correctly in ASP.NET

    - by Nick
    I have a security class: public class security { private static string createSalt(int size) { //Generate a random cryptographic number RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); byte[] b = new byte[size]; rng.GetBytes(b); //Convert to Base64 return Convert.ToBase64String(b); } /// <summary> /// Generate a hashed password for comparison or create a new one /// </summary> /// <param name="pwd">Users password</param> /// <returns></returns> public static string createPasswordHash(string pwd) { string salt = "(removed)"; string saltAndPwd = string.Concat(pwd, salt); string hashedPwd = FormsAuthentication.HashPasswordForStoringInConfigFile( saltAndPwd, "sha1"); return hashedPwd; } } This works fine, but I am wondering if it is sufficient enough. Also, is this next block of code better? Overkill? static byte[] encrInitVector = new byte[] { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF }; static string encrKey = "(removed)"; public static string EncryptString(string s) { byte[] key; try { key = Encoding.UTF8.GetBytes(encrKey.Substring(0, 8)); DESCryptoServiceProvider des = new DESCryptoServiceProvider(); byte[] inputByteArray = Encoding.UTF8.GetBytes(s); MemoryStream ms = new MemoryStream(); CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(key, encrInitVector), CryptoStreamMode.Write); cs.Write(inputByteArray, 0, inputByteArray.Length); cs.FlushFinalBlock(); return Convert.ToBase64String(ms.ToArray()); } catch (Exception e) { throw e; }

    Read the article

  • Java: file write on finalize method

    - by sowrov
    In my understanding a singleton object will destroy only when the application is about to terminate. So in C++ I write a Singleton class to log my application and in that Singleton logger's destructor I log the time when my application was terminated. Things worked perfectly in C++. Now I want to have that same logger in Java, as in java there is no destructor so I implemented the finalize method for that singleton logger. But it seem that finalize method actually never get called. So, I add that System.runFinalizersOnExit(true); line, somewhere in my code (though I know it is deprecated) and that finalize method get called every time before termination of the app. But still there is a problem! If I try to write anything on file in that finalize method, It does not work, though System.out work without any problem! :( Can you guys help me on this problem? Here is a sample code of what I am try to do: Singleton Logger Class: public class MyLogger { FileWriter writer; private MyLogger() { try { this.writer = new FileWriter("log.txt"); } catch (IOException ex) { } } public static MyLogger getInstance() { return MyLoggerHolder.INSTANCE; } private static class MyLoggerHolder { private static final MyLogger INSTANCE = new MyLogger(); } @Override protected void finalize () { try { super.finalize(); System.out.println("Here"); //worked correctly. this.writer.write(new Date().toString()+System.getProperty("line.separator")); this.writer.write("End"); this.writer.flush(); //does not work! this.writer.close(); } catch (Throwable ex) { } } public synchronized void log(String str) { try { this.writer.write(new Date().toString()+System.getProperty("line.separator")); this.writer.write(str+"\n"); this.writer.flush(); } catch (IOException ex) { } } } Main: public class Main { public static void main(String[] args) { System.runFinalizersOnExit(true); MyLogger logger = MyLogger.getInstance(); logger.log("test"); } }

    Read the article

  • Operating System Widget Side Project

    - by Calpis
    I want to start on a side project and here's my idea: Whenever the user's mouse is pressed down, I want a small ring around the cursor to show up. I'm mainly doing this to learn more about programming and get myself to think outside of work related materials. My questions are: 1) is there a good source I can reference to start a project that deals with something like this? 2) Is visual studio a sufficient software to create such an application? Or would I need some other tool to do this. 3) What language should I choose to do this task? Thanks in advance!

    Read the article

  • How to execute a program from file descriptor?

    - by stribika
    I need to execute a file when I only know the descriptor. It is also possible that there are no links to the file so finding out the name somehow is not an option. All the execve(), execvp(), etc functions take a file name. dlopen() also takes a name. Ugly solutions (like reading the file and calling some function pointer) are OK.

    Read the article

  • Encrypting and decrypting strings

    - by dretzlaff17
    Does anyone know of a good way to encrypt and decrypt strings using VB6 to ensure sensitive data is secure? Also, is there an encryption method that can be shared between VB6 and .NET? Example: The encrypted string will be written to a database using a VB6 application, but the value also need to be read an decrypted in a c# .net application using the .net framework if possible. Thanks!

    Read the article

  • Read part of a file in PHP

    - by Johan
    I would like to read the last 1 megabyte of a MP3 file and calculate SHA1 checksum for just that part of the file. The reason that I would want this is that when I'm looking for duplicate MP3's, the header info (song title, album etc.) can differ even though it's the exakt same audio file, so I figured I would be better of to checksum a part of the file at the end instead of the whole one. Is there an efficient way of doing this?

    Read the article

  • CakePHP 1.3.0 Cookie value not encrypting

    - by Jason McCreary
    I noticed in Firefox when viewing the cookies that the values I am saving are not encrypted. The CakePHP Book states that values are encrypted by default on write(). I can't seem to find any gotchas in the doc Anyone else experience this problem? I am sure I am missing something.. Would it matter that the value being set is a integer?

    Read the article

  • Unix file permission for groups

    - by GOPI
    I am working on HP Unix server. I have a directory in which users from different groups need to create files. And the users of a same group should have complete access to the files created by their group and only read access for the files created by other groups. I tried to set sticky bit for the directory thereby to restrict access for other groups. But I face the following problem. Created File1 from user1 of GroupA. When I tried to execute the 'rm' command from user2 of the same group GroupA, it doesn't allow as user2 is not the owner of the file. can setgid (at directory level) or other command help me to sort this issue?

    Read the article

  • Wierd Windows File Share Behavior

    - by CT
    Scratching my head awhile on this. I'm on a Vista client trying to access a file share running on a Windows Server 2008 R2 box. Windows Active Directory Domain. The shares I am trying to access: \\Server1\FileShare1\Folder1\foo and \\Server1\FileShare1\Folder1\bar The client does not have any permissions at Folder1. The client has read permissions at folders foo and bar. In this example I can access \Server1\FileShare1\Folder1\foo but I get the following error when I try to access \Server1\FileShare1\Folder1\bar: "Network Error: Windows cannot access \Server1\FileShare1\Folder1\bar. Check the spelling of the name. Otherwise, there might be a problem with your network. To try to identify and resolve network problems, click Diagnose" I hit Diagnose. It returns with "Windows checked the path and '\Server1\FileShare1' is correct but 'Folder1' could not be found." What is going on? It finds Folder1 fine when going to \Server1\FileShare1\Folder1\foo.

    Read the article

  • how to write or create (when no exist) a file using python and Google AppEngine

    - by zjm1126
    this is my code: f = open('text/a.log', 'wb') f.write('hahaha') f.close() and it is not create a new file when not exist how to do this , thanks updated class MyThread(threading.Thread): def run(self): f = open('a.log', 'w') f.write('hahaha') f.close() error is : Traceback (most recent call last): File "D:\Python25\lib\threading.py", line 486, in __bootstrap_inner self.run() File "D:\zjm_code\helloworld\views.py", line 15, in run f = open('a.log', 'w') File "d:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1188, in __init__ raise IOError('invalid mode: %s' % mode) IOError: invalid mode: w

    Read the article

  • IIS wont run a BAT File

    - by Ye Ol Developer
    The problem we have run into is as follows. We have an ASP.NET WebService which runs under IIS7. The code in the WebService works 100%, however when the WebService tries to run a .BAT file, nothing happens. Nothing at all, the code doesn't crash, the server doesn't warn us about anything, nothing at all. We have tried setting the User Permissions, we have attempted difference ways of running the BAT, we have tried playing around with the registry, cmd.exe has full rights as well. We are now quite stumped as of what to do, any help would be appreciated.

    Read the article

  • Multicast File copy with Unicast responses

    - by kirbuchi
    I'm trying to do some multicast big file copies over to remote clients on the other side of a satellite link. The idea is to minimize the amount of traffic going up to the satellite. I tried using uftp without luck. The problem is that, even though we can reach clients via multicast from our central Hub, they aren't able to respond to a multicast address (it's not supported by the return link). As uftp needs to respond to a multicast address in order to report any missing packets I'm out of luck. So does anyone have any recommendations or alternatives I can use to do the trasfers? Any tip or pointer would be appreciated.

    Read the article

  • bat file to disable ethernet adaptor and then reenable it after windows log in

    - by jaslr
    When I log into Windows 7 I need to wait 10 seconds and then disable the Local Area Connection (ethernet adaptor) and then reenable it. I have looked through the suggested answer: Enable/disable wireless interface in a bat file but that seems irrelevant as it just toggles the current state. From what I can tell I need to include: netsh interface set interface "Local Area Connection" DISABLED netsh interface set interface "Local Area Connection" ENABLED but I'm unsure of the wait time or how I can have this start after Windows has successfully logged in. What's the best approach here?

    Read the article

  • How do I log file system read/writes by filename in Linux?

    - by Casey
    I'm looking for a simple method that will log file system operations. It should display the name of the file being accessed or modified. I'm familiar with powertop, and it appears this works to an extent, in so much that it show the user files that were written to. Is there any other utilities that support this feature. Some of my findings: powertop: best for write access logging, but more focused on CPU activity iotop: shows real time disk access by process, but not file name lsof: shows the open files per process, but not real time file access iostat: shows the real time I/O performance of disk/arrays but does not indicate file or process

    Read the article

  • Seeking to a line in a file in g++

    - by Phenom
    Is there a way that I can seek to a certain line in a file to read or write data? Let's say I want to write some data starting on the 10th line in a text file. There might be some data already in the first few lines, or the file could even be empty. Is there a way I can seek directly to the line I want without having to worry about what's already in the file?

    Read the article

  • Problem with RSA-encrypting a string in PHP and passing it to .NET service

    - by jonasaxelsson
    I need to call a web service that requires a login url containing an RSA encrypted, base_64 encoded and url-encoded login data. I don't have a formal php training, but even for me it seems like an easy task, however when calling the service I get an 'Invalid Format' response. What am I doing wrong and is there another way to come up with the encrypted string? Code example below. Thank you for your help! http://www.edsko.net/misc/ for encryption. $message = '?id=112233&param1=hello&[email protected]&name=Name'; $keyLength = '2048'; $exponent = '65537'; $modulus = '837366556729991345239927764652........'; $encryptedData = rsa_encrypt($message, $exponent, $modulus, $keyLength); $data = urlencode(base64_encode($encryptedData)); $loginurl = 'http://www.somedomain.com/LoginWB.aspx?Id=9876&Data='.$data; echo '<iframe src="'.$loginurl.'" width="570px" height="800px">'; echo '</iframe>'; ?

    Read the article

  • How can I run a batch file silently?

    - by Mike Pateras
    I have a batch file with some commands that I need to run with my installer, but I'd rather a console not appear (in Windows). I'm executing the batch file from a WiX installer, via a custom action. I tried adding an @ECHO OFF to the top of the file, but that didn't seem to do anything. Is there a way that I can run this batch file silently?

    Read the article

  • Check directory for files, retrieve first file

    - by Lowgain
    I'm writing a small ruby daemon that I am hoping will do the following: Check if a specific directory has files (in this case, .yml files) If so, take the first file (numerically sorted preferrably), and parse into a hash Do a 'yield', with this hash as the argument What I have right now is like: loop do get_next_in_queue { |s| THINGS } end def get_next_in_queue queue_dir = Dir[File.dirname(__FILE__)+'/../queue'] info = YAML::load_file(queue_dir[0]) #not sure if this works or not yield info end I'd like to make the yield conditional if possible, so it only happens if a file is actually found. Thanks!

    Read the article

  • Java: Check if file is already open

    - by hello_world_infinity
    I need to write a custom batch File renamer. I've got the bulk of it done except I can't figure out how to check if a file is already open. I'm just using the java.io.File package and there is a canWrite() method but that doesn't seem to test if the file is in use by another program. Any ideas on how I can make this work?

    Read the article

  • file sharing over external and internal networks

    - by pradvk
    Dear friends, Please tell me whether it is possible for someone on the external network to see the network folder shares of an internal LAN network in DHCP (192.168.x.x) through a Comp-A on an external network in DHCP (123.123.x.x) both networks are on different subnets but Comp-A has access to both networks and can see all the shared drives of both the internal and external networks using firewall is not an option because file sharing is required everywhere. care is taken from viruses/trojans... remote desktop etc is disabled on Comp-A Please let me know. Thanks and Regards pk

    Read the article

< Previous Page | 52 53 54 55 56 57 58 59 60 61 62 63  | Next Page >