The objective of this study was to enhance oxidative stability of walnuts present in active packages produced by electrospinning technology. Gallic acid was encapsulated into lentil flour/polyethylene oxide (PEO) nanofibers. To promote the solubility of lentil proteins, pH of solutions was adjusted to pH 1 and pH 10 which were far away from isoelectric point of lentil proteins. While acidic solutions had lower viscosity values than alkaline solutions, their electrical conductivity values were significantly higher. When the scanning electron microscopy (SEM) images were examined, it should be noted that alkaline nanofibers showed homogenous structure. Although gallic acid was not so stable at alkaline conditions, gallic acid loaded nanofibers prepared at alkaline pH still showed antioxidant activity after electrospinning. The physical and thermal properties of encapsulated gallic acid and nanofibers were examined by Fourier transform infrared spectroscopy (FTIR), thermal gravimetric analysis (TGA) and differential scanning calorimeter (DSC) analyses. FTIR results indicated the effect of pH on chemical properties of nanofibers and the interaction between gallic acid and lentil flour-based nanofibers. Gallic acid addition reduced onset temperature and thermal stability. Therefore, it could be taken as evidence of incorporation of gallic acid. Disappearance of enthalpic peak related to melting of crystalline structure of gallic acid in DSC thermal curves confirmed successful encapsulation of gallic acid. Fabricated gallic acid loaded nanofibers were used to pack walnuts and the reduction in oxidation of walnuts with lower peroxide, p-anisidine and Totox values was observed. This would make these packaging materials substantially preferable for packing of foods being highly susceptible to oxidation.