Both there are multiable security techniques for each issue for example you are using encoding to save your data from be read by unauthorized entity and ssl to be sure that your package reach to certified server, each security issue have its fixes, and it is depends on your requirments