https://cdn.apisetu.gov.in/portal/home/_next/static/chunks/pages/encrypt-decrypt-70d0d833ee91ab89.js
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[263],{2138:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/encrypt-decrypt",function(){return a(9461)}])},5949:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var r=a(7876);a(2987);var s=a(5106);a(8230),a(8880);var n=a(4403),o=a(4194);let i=e=>{let{data:t}=e;return(0,r.jsx)("div",{className:"bg-[#09314D]",children:(0,r.jsxs)("div",{className:"container mx-auto md:px-10 px-4 pt-14 grid grid-cols-5",children:[(0,r.jsx)("div",{className:"md:col-span-3 col-span-5 flex h-full items-center",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-[32px] text-[#FF8000] font-bold mb-6 leading-[37.57px]",children:(0,r.jsx)(o.A,{children:"Reach new heights with API Setu"})}),(0,r.jsx)("p",{className:"text-xl max-w-screen-md mb-6 relative leading-[30px] text-[#E7E7E7]",children:(0,r.jsx)(o.A,{children:"Unleash the power of APIs! Add your own collections to our marketplace and join the API revolution today."})}),(0,r.jsxs)("a",{className:" getStartedWhite mx-auto inline-block",href:"https://partners.apisetu.gov.in/signup",children:[(0,r.jsx)(o.A,{children:" Get Started"})," ",(0,r.jsx)(s.eW4,{className:"inline-block ml-1 icon "})]})]})}),(0,r.jsx)("div",{className:"md:col-span-2 col-span-5 ",children:(0,r.jsx)(n.A,{src:"/To the stars-amico 1.png",alt:"API Setu to the stars amico",width:400,height:400,className:"h-full w-full"})})]})})}},9226:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var r=a(7876);a(4232);var s=a(7328),n=a.n(s);let o=e=>{let{main:t}=e;return(0,r.jsxs)(n(),{children:[(0,r.jsx)("meta",{charSet:"utf-8"}),(0,r.jsx)("meta",{httpEquiv:"X-UA-Compatible",content:"IE=edge"}),(0,r.jsx)("title",{children:t}),(0,r.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0"}),(0,r.jsx)("link",{rel:"icon",href:"".concat("https://cdn.digilocker.gov.in","/ndh/smart/images/apisetu_icon.png")}),(0,r.jsx)("meta",{name:"description",content:"API Setu, API Directory, API Setu,is an Open API (Application Programming Interface) Platform from Ministry of Electronics and IT, Government of India. An API platform to enable swift, transparent, safe and reliable information sharing across applications and to promote innovation. "}),(0,r.jsx)("meta",{name:"keywords",content:"API Setu, API Directory, API, APIs, DigiLocker Partners, API Provider, Free API, API Provider in India, API Hub, openAPI, Free Public API, Open Rest APIs, NAD APIs, Academic Bank of Credits (ABC) Partners APIs, NSSO MeriPehchaan APIs, UMANG APIs, myScheme APIs, Get access to hundreds of APIs, APIS, Government APIs, Publisher, Consumer,API Management, Explore the world of APIs, DigiLocker, Digital Locker, aadhar, aadhaar card, Class X Result, Class XII result, Class 10, Class 12, CBSE, download, download result, Access, verification, documents, e-governance, secure, e-documents, Sharing of e-documents online, upload e-documents, SSC Certificate, Epfo, passbook, passport, driving license, land records, identity, proofs, hiring, vacancy, HSC Certificate, PAN card, Voter ID card, Department Issued Documents, digital India, digital India initiative, Government of India's Flagship program, paperless governance, Govt. of Indiaâs cloud based platform, official, officially Valid Document, OVD, IT ACT"}),(0,r.jsx)("meta",{property:"tag",content:"API Setu, APIs, API Directory, Government APIs, Publisher, Consumer, API Provider, Free API, API Provider in India, API Hub, openAPI, Free Public API, Open Rest APIs, DigiLocker Partners, NAD Partners, Academic Bank of Credits (ABC) Partners, NSSO MeriPehchaan, UMANG, myScheme, API Management, Explore the world of APIs, DigiLocker, Digital Locker, aadhar, aadhaar card, Class X Result, Class XII result, Class 10, Class 12, CBSE, download, download result, Access, verification, documents, e-governance, secure, e-documents, Sharing of e-documents online, upload e-documents, SSC Certificate, Epfo, passbook, passport, driving license, land records, identity, proofs, hiring, vacancy, HSC Certificate, PAN card, Voter ID card, Department Issued Documents, digital India, digital India initiative, Government of India's Flagship program, paperless governance, Govt. of Indiaâs cloud based platform, official, officially Valid Document, OVD, IT ACT"}),(0,r.jsx)("meta",{name:"google-site-verification",content:"UJFFbrXdFWRJKOdOxBWCcbP5woSkLU0lJOZYxOeB73c"}),(0,r.jsx)("meta",{name:"author",content:"API Setu"}),(0,r.jsx)("meta",{property:"og:title",content:t}),(0,r.jsx)("meta",{property:"og:description",content:"API Setu is an Open API (Application Programming Interface) Platform from Ministry of Electronics and IT, Government of India. An API platform to enable swift, transparent, safe and reliable information sharing across applications and to promote innovation. "}),(0,r.jsx)("meta",{property:"og:image",content:"https://apisetu.gov.in/apisetu_logo.png"})]})}},9461:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>l});var r=a(7876),s=a(4232),n=a(9226),o=a(5949),i=a(2448);
1function l(){let[e,t]=(0,s.useState)(""),[a,l]=(0,s.useState)("abc123"),[c,d]=(0,s.useState)(""),[p,m]=(0,s.useState)(""),[u,h]=(0,s.useState)(""),[x,f]=(0,s.useState)(""),[g,y]=(0,s.useState)("abc123"),[A,I]=(0,s.useState)(""),[P,v]=(0,s.useState)(""),[b,j]=(0,s.useState)(""),w=async()=>{if(d(""),""==e||""==a)h("Missing Plaintext or Encrypt Key"),m("");else try{let t=await (0,i.Y6)(),r=await fetch("/api/encryptdecrypt",{method:"POST",headers:{"Content-Type":"application/json",...t},body:JSON.stringify({action:"encrypt",data:e,password:a})}),s=await r.json();r.ok?(m("Encrypted Successfully !"),h(""),d(s.result)):(h(s.message||"Encryption failed"),m(""))}catch(e){console.error("Decryption failed:",e)}},S=async()=>{if(I(""),""==x||""==g)j("Missing Decryption Text or Decrypt Key"),v("");else try{let e=await (0,i.Y6)(),t=await fetch("/api/encryptdecrypt",{method:"POST",headers:{"Content-Type":"application/json",...e},body:JSON.stringify({action:"decrypt",data:x,password:g})}),a=await t.json();t.ok?(v("Decrypted Successfully !"),j(""),I(a.result)):(j(a.message||"Decryption failed"),v(""),I(""))}catch(e){console.error("Decryption failed:",e)}};return(0,r.jsxs)("div",{children:[(0,r.jsx)(n.A,{main:"Encrypt / Decrypt | APISetu"}),(0,r.jsx)("section",{className:"min-h-screen flex flex-col items-center justify-center",children:(0,r.jsxs)("div",{className:"w-full max-w-5xl mx-auto px-4",children:[(0,r.jsx)("h3",{className:"text-2xl font-bold text-center mb-8 mt-8",style:{color:"#35404e"},children:"AES 256 CBC Encrypt / Decrypt"}),(0,r.jsxs)("div",{className:"grid md:grid-cols-2 gap-8 mb-10",children:[(0,r.jsxs)("div",{className:"border p-6 rounded-lg shadow-md",children:[(0,r.jsx)("h4",{className:"text-lg font-semibold mb-4",children:"Encrypt"}),(0,r.jsx)("textarea",{className:"w-full border p-2 rounded mb-4",rows:"6",placeholder:"Enter text to encrypt",value:e,onChange:e=>t(e.target.value)}),(0,r.jsx)("input",{type:"text",className:"w-full border p-2 rounded mb-4",placeholder:"Enter encryption key",value:a,onChange:e=>l(e.target.value)}),(0,r.jsx)("button",{className:"font-bold rounded-md focus:ring-4 text-sm px-4 md:px-6 py-2 lg:py-2.5 border border-[#09314D] bg-[#09314D] text-white hover:bg-white hover:text-[#09314D] hidden lg:block",onClick:w,children:"Encrypt"}),(0,r.jsx)("p",{className:"text-green-500 mt-2",children:p}),(0,r.jsx)("p",{className:"text-red-500 mt-2",children:u}),(0,r.jsx)("textarea",{className:"w-full border p-2 rounded mt-4",rows:"6",placeholder:"Encrypted text will appear here",value:c,readOnly:!0})]}),(0,r.jsxs)("div",{className:"border p-6 rounded-lg shadow-md",children:[(0,r.jsx)("h4",{className:"text-lg font-semibold mb-4",children:"Decrypt"}),(0,r.jsx)("textarea",{className:"w-full border p-2 rounded mb-4",rows:"6",placeholder:"Enter encrypted text",value:x,onChange:e=>f(e.target.value)}),(0,r.jsx)("input",{type:"text",className:"w-full border p-2 rounded mb-4",placeholder:"Enter decryption key",value:g,onChange:e=>y(e.target.value)}),(0,r.jsx)("button",{className:"font-bold rounded-md focus:ring-4 text-sm px-4 md:px-6 py-2 lg:py-2.5 border border-[#09314D] bg-[#09314D] text-white hover:bg-white hover:text-[#09314D] hidden lg:block",onClick:S,children:"Decrypt"}),(0,r.jsx)("p",{className:"text-green-500 mt-4",children:P}),(0,r.jsx)("p",{className:"text-red-500 mt-2",children:b}),(0,r.jsx)("textarea",{className:"w-full border p-2 rounded mt-2",rows:"6",placeholder:"Decrypted text will appear here",value:A,readOnly:!0})]})]})]})}),(0,r.jsx)(o.A,{})]})}}},e=>{e.O(0,[715,636,593,792],()=>e(e.s=2138)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.