While you can do this, I personally don't recommend it. I have had pickles and garlic seem discolored when I have substituted. I recommend buying pickling salt and using it.