We study the reconstruction algorithm effect on the positive and negative ghost imaging (GI). By introducing three GI algorithms (logarithmic GI, exponential GI and trigonometric GI), we perform numerical simulations and experiments with different GI algorithms, which demonstrate that a positive or negative ghost image can be recovered by modulating the monotonicity of the bucket object signal function. Furthermore, we propose a positive-negative optical encryption scheme based on trigonometric GI. Our work not only broadens the positive-negative GI principle but also paves a way to its applications in optical encryption.